3232 0x28d709c875c0ceac3dce7065bec5328186dc89fe254527084d1689910954b0a ,
3333 0x0000000000000000000000000000000000000000 ,
3434)
35+ RETH = Currency (
36+ "RETH" ,
37+ 18 ,
38+ 0 ,
39+ 0x0319111a5037cbec2b3e638cc34a3474e2d2608299f3e62866e9cc683208c610 ,
40+ 0xae78736cd615f374d3085123a210448e74fc6393 ,
41+ )
3542USD = Currency ("USD" , 8 , 1 , 0 , 0 )
3643XSTRK = Currency (
3744 "XSTRK" ,
4047 0x028d709c875c0ceac3dce7065bec5328186dc89fe254527084d1689910954b0a ,
4148 0x0000000000000000000000000000000000000000 ,
4249)
43- CONVERSION_XSTRK = Currency (
44- "CONVERSION_XSTRK" ,
50+ DOG = Currency (
51+ "DOG" ,
52+ 5 ,
53+ 0 ,
54+ 0x0 ,
55+ 0x0000000000000000000000000000000000000000 ,
56+ )
57+ CONVERSION_SSTRK = Currency (
58+ "CONVERSION_SSTRK" ,
4559 18 ,
4660 0 ,
4761 0x0000000000000000000000000000000000000000 ,
4862 0x0000000000000000000000000000000000000000 ,
4963)
50- pair = Pair (CONVERSION_XSTRK , USD )
51-
64+ XWBTC = Currency (
65+ "CONVERSION_XWBTC" ,
66+ 8 ,
67+ 0 ,
68+ 0x6a567e68c805323525fe1649adb80b03cddf92c23d2629a6779f54192dffc13 ,
69+ 0x0000000000000000000000000000000000000000 ,
70+ )
71+ XTBTC = Currency (
72+ "CONVERSION_XTBTC" ,
73+ 18 ,
74+ 0 ,
75+ 0x43a35c1425a0125ef8c171f1a75c6f31ef8648edcc8324b55ce1917db3f9b91 ,
76+ 0x0000000000000000000000000000000000000000 ,
77+ )
78+ XLBTC = Currency (
79+ "CONVERSION_XLBTC" ,
80+ 8 ,
81+ 0 ,
82+ 0x7dd3c80de9fcc5545f0cb83678826819c79619ed7992cc06ff81fc67cd2efe0 ,
83+ 0x0000000000000000000000000000000000000000 ,
84+ )
85+ XSBTC = Currency (
86+ "CONVERSION_XSBTC" ,
87+ 18 ,
88+ 0 ,
89+ 0x580f3dc564a7b82f21d40d404b3842d490ae7205e6ac07b1b7af2b4a5183dc9 ,
90+ 0x0000000000000000000000000000000000000000 ,
91+ )
5292
53- CURRENCIES_TO_ADD = [CONVERSION_XSTRK ]
93+ # New currencies
94+ MRE7BTC = Currency (
95+ "MRE7BTC" ,
96+ 18 ,
97+ 0 ,
98+ 0x0 , # Replace with actual starknet_address if available
99+ 0x0000000000000000000000000000000000000000 ,
100+ )
101+ MRE7YIELD = Currency (
102+ "MRE7YIELD" ,
103+ 18 ,
104+ 0 ,
105+ 0x0 , # Replace with actual starknet_address if available
106+ 0x0000000000000000000000000000000000000000 ,
107+ )
108+ LBTC = Currency (
109+ "LBTC" ,
110+ 8 ,
111+ 0 ,
112+ 0x0 , # Replace with actual starknet_address if available
113+ 0x0000000000000000000000000000000000000000 ,
114+ )
115+ UNIBTC = Currency (
116+ "UNIBTC" ,
117+ 8 ,
118+ 0 ,
119+ 0x0 , # Replace with actual starknet_address if available
120+ 0x0000000000000000000000000000000000000000 ,
121+ )
54122
55- PAIRS_TO_ADD = [pair ]
123+ # BTC LST pairs
124+ xwbtc_usd_pair = Pair (XWBTC , USD )
125+ xtbtc_usd_pair = Pair (XTBTC , USD )
126+ xlbtc_usd_pair = Pair (XLBTC , USD )
127+ xsbtc_usd_pair = Pair (XSBTC , USD )
128+
129+ # New pairs
130+ mre7btc_usd_pair = Pair (MRE7BTC , USD )
131+ mre7yield_usd_pair = Pair (MRE7YIELD , USD )
132+ lbtc_usd_pair = Pair (LBTC , USD )
133+ unibtc_usd_pair = Pair (UNIBTC , USD )
134+
135+ CURRENCIES_TO_ADD = [XWBTC , XTBTC , XLBTC , XSBTC ]
136+
137+ PAIRS_TO_ADD = [
138+ xwbtc_usd_pair ,
139+ xtbtc_usd_pair ,
140+ xlbtc_usd_pair ,
141+ xsbtc_usd_pair ,
142+ ]
56143
57144PAIRS_TO_UPDATE = [
58- # {
59- # "pair_id": "1629317993172502401860",
60- # "pair": ["1629317993172502401860", USD.id, XSTRK.id]
61- # }
145+ {
146+ "pair_id" : 384270964630611589151504336040458606883082949444 ,
147+ "pair" : [384270964630611589151504336040458606883082949444 , XWBTC .id , USD .id ],
148+ },
149+ {
150+ "pair_id" : 384270964630611589151504336040242434100969165636 ,
151+ "pair" : [384270964630611589151504336040242434100969165636 , XTBTC .id , USD .id ],
152+ },
153+ {
154+ "pair_id" : 384270964630611589151504336039665973348665742148 ,
155+ "pair" : [384270964630611589151504336039665973348665742148 , XLBTC .id , USD .id ],
156+ },
62157 # Pair(XSTRK, USD),
63158 # Pair("SSTRK/USD", "SSTRK", "USD"),
64159 # Pair("WSTETH/USD", "WSTETH", "USD"),
@@ -70,16 +165,17 @@ async def main(port: Optional[int]) -> None:
70165 Main function to add currencies and pairs, and update pairs.
71166 """
72167 # Add Currencies
73- for currency in CURRENCIES_TO_ADD :
74- tx_hash = await invoke (
75- "pragma_Oracle" ,
76- "add_currency" ,
77- currency .serialize (),
78- port = port ,
79- )
80- logger .info (f"Added currency { currency } with tx hash { hex (tx_hash )} " )
81-
82- # Update Pairs
168+ # for currency in CURRENCIES_TO_ADD:
169+ # tx_hash = await invoke(
170+ # "pragma_Oracle",
171+ # "add_currency",
172+ # currency.serialize(),
173+ # port=port,
174+ # )
175+ # await asyncio.sleep(1)
176+ # logger.info(f"Added currency {currency} with tx hash {hex(tx_hash)}")
177+
178+ # # Update Pairs
83179 for pair in PAIRS_TO_UPDATE :
84180 tx_hash = await invoke (
85181 "pragma_Oracle" ,
@@ -89,15 +185,25 @@ async def main(port: Optional[int]) -> None:
89185 )
90186 logger .info (f"Updated pair { pair } with tx hash { hex (tx_hash )} " )
91187
92- # Add Pairs
93- for pair in PAIRS_TO_ADD :
94- tx_hash = await invoke (
95- "pragma_Oracle" ,
96- "add_pair" ,
97- pair .serialize (),
98- port = port ,
99- )
100- logger .info (f"Added pair { pair } with tx hash { hex (tx_hash )} " )
188+ # # Add Pairs
189+ # for pair in PAIRS_TO_ADD[2:]:
190+ # tx_hash = await invoke(
191+ # "pragma_Oracle",
192+ # "add_pair",
193+ # (pair.id, pair.quote_currency.id, pair.base_currency.id),
194+ # port=port,
195+ # )
196+ # await asyncio.sleep(1)
197+ # logger.info(f"Added pair {pair} with tx hash {hex(tx_hash)}")
198+
199+ # for pair in PAIRS_TO_ADD:
200+ # tx_hash = await invoke(
201+ # "pragma_Oracle",
202+ # "add_registered_conversion_rate_pair",
203+ # [pair.id],
204+ # port=port,
205+ # )
206+ # logger.info(f"Added conversion rate pair {pair} with tx hash {hex(tx_hash)}")
101207
102208
103209@click .command ()
0 commit comments