88from df_py .util .graphutil import submit_query
99from df_py .util .networkutil import DEV_CHAINID
1010
11+ WHITELIST_FEEDS_MAINNET = [
12+ "0x18f54cc21b7a2fdd011bea06bba7801b280e3151" ,
13+ "0x2d8e2267779d27c2b3ed5408408ff15d9f3a3152" ,
14+ "0x30f1c55e72fe105e4a1fbecdff3145fc14177695" ,
15+ "0x31fabe1fc9887af45b77c7d1e13c5133444ebfbd" ,
16+ "0x3fb744c3702ff2237fc65f261046ead36656f3bc" ,
17+ "0x55c6c33514f80b51a1f1b63c8ba229feb132cedb" ,
18+ "0x74a61f733bd9a2ce40d2e39738fe4912925c06dd" ,
19+ "0x8165caab33131a4ddbf7dc79f0a8a4920b0b2553" ,
20+ "0x93f9d558ccde9ea371a20d36bd3ba58c7218b48f" ,
21+ "0x9c4a2406e5aa0f908d6e816e5318b9fc8a507e1f" ,
22+ "0xa2d9dbbdf21c30bb3e63d16ba75f644ac11a0cf0" ,
23+ "0xaa6515c138183303b89b98aea756b54f711710c5" ,
24+ "0xb1c55346023dee4d8b0d7b10049f0c8854823766" ,
25+ "0xbe09c6e3f2341a79f74898b8d68c4b5818a2d434" ,
26+ "0xd41ffee162905b45b65fa6b6e4468599f0490065" ,
27+ "0xd49cbfd694f4556c00023ddd3559c36af3ae0a80" ,
28+ "0xe66421fd29fc2d27d0724f161f01b8cbdcd69690" ,
29+ "0xf28c94c55d8c5e1d70ca3a82744225a4f7570b30" ,
30+ "0xf8c34175fc1f1d373ec67c4fd1f1ce57c69c3fb3" ,
31+ "0xfa69b2c1224cebb3b6a36fb5b8c3c419afab08dd" ,
32+ ]
33+
1134
1235@enforce_types
1336def key_to_725 (key : str ):
@@ -116,16 +139,15 @@ def query_predictoor_contracts(chain_id: int) -> Dict[str, PredictContract]:
116139 if len (predictoor_contracts ) == 0 :
117140 break
118141 for contract in predictoor_contracts :
119- owner = contract ["token" ]["nft" ]["owner" ]["id" ]
120- if chain_id != DEV_CHAINID and owner not in DEPLOYER_ADDRS [chain_id ]:
121- continue
142+ if contract ["id" ] not in WHITELIST_FEEDS_MAINNET :
143+ owner = contract ["token" ]["nft" ]["owner" ]["id" ]
144+ if chain_id != DEV_CHAINID and owner not in DEPLOYER_ADDRS [chain_id ]:
145+ continue
122146
123- nft_addr = contract ["token" ]["nft" ]["id" ]
124- info725 = contract ["token" ]["nft" ]["nftData" ]
125- info = info_from_725 (info725 )
126- pair = info ["pair" ]
127- timeframe = info ["timeframe" ]
128- source = info ["source" ]
147+ nft_addr = contract ["id" ]
148+ pair = contract ["token" ]["name" ].replace ("/" , "-" )
149+ timeframe = "5m" if int (contract ["secondsPerEpoch" ]) == 300 else "1h"
150+ source = "binance"
129151
130152 asset_name = f"{ pair } -{ source } -{ timeframe } "
131153
@@ -138,6 +160,8 @@ def query_predictoor_contracts(chain_id: int) -> Dict[str, PredictContract]:
138160 contract ["secondsPerSubscription" ],
139161 )
140162 contracts_dict [nft_addr ] = contract_obj
163+
164+ print (contracts_dict )
141165 return contracts_dict
142166
143167
@@ -214,17 +238,22 @@ def query_predictoors(st_ts: int, end_ts: int, chainID: int) -> Dict[str, Predic
214238 raise AssertionError (result )
215239
216240 predictions = result ["data" ]["predictPredictions" ]
241+ print (len (predictoors ))
217242 if len (predictions ) == 0 :
218243 break
219244
220245 for prediction_dict in predictions :
221- owner = prediction_dict ["slot" ]["predictContract" ]["token" ]["nft" ]["owner" ][
222- "id"
223- ]
224- if chainID != DEV_CHAINID :
225- if owner not in DEPLOYER_ADDRS [chainID ]:
226- print ("noowner" , owner , chainID , DEPLOYER_ADDRS )
227- continue
246+ if (
247+ prediction_dict ["slot" ]["predictContract" ]["id" ]
248+ not in WHITELIST_FEEDS_MAINNET
249+ ):
250+ owner = prediction_dict ["slot" ]["predictContract" ]["token" ]["nft" ][
251+ "owner"
252+ ]["id" ]
253+ if chainID != DEV_CHAINID :
254+ if owner not in DEPLOYER_ADDRS [chainID ]:
255+ print ("noowner" , owner , chainID , DEPLOYER_ADDRS )
256+ continue
228257 predictoor_addr = prediction_dict ["user" ]["id" ]
229258
230259 # 0 - Pending
0 commit comments