Compare commits

..

2 Commits

Author SHA1 Message Date
tim
a4a2f6e318 gmx metadata and backfill in finaldata 2025-06-17 00:37:52 -04:00
tim
97f98ba7cf gmx metadata and backfill in finaldata 2025-06-16 20:06:12 -04:00

View File

@@ -78,6 +78,17 @@ event_handlers = {
'ClaimableFundingAmountPerSizeUpdated': None, 'ClaimableFundingAmountPerSizeUpdated': None,
'FundingFeesClaimed': None, 'FundingFeesClaimed': None,
'FeesClaimed': None,
'SetAvailableFeeAmount': None,
'BuybackFees': None,
'OrderSizeDeltaAutoUpdated': None,
'SubaccountAutoTopUp': None,
'SetSubaccountAutoTopUpAmount': None,
'SetMaxAllowedSubaccountActionCount': None,
'AffiliateRewardClaimed': None,
'CollateralClaimed': None,
'ExecutionFeeRefundCallback': None,
'PoolAmountUpdated': None, 'PoolAmountUpdated': None,
'VirtualSwapInventoryUpdated': None, 'VirtualSwapInventoryUpdated': None,
@@ -160,8 +171,6 @@ def create_backfill_handler(ohlcs: FinalOHLCRepository):
updates = await fetch_price_updates() updates = await fetch_price_updates()
backfill_addrs = [addr for addr, time, price in updates if not ohlcs.has_symbol(addr)] backfill_addrs = [addr for addr, time, price in updates if not ohlcs.has_symbol(addr)]
backfill_addrs = [backfill_addrs[0]] # todo remove debug
if backfill_addrs: if backfill_addrs:
log.info(f'Backfilling {len(backfill_addrs)} new GMX tokens') log.info(f'Backfilling {len(backfill_addrs)} new GMX tokens')
await asyncio.gather(*[backfill_token(ohlcs, a) for a in backfill_addrs]) await asyncio.gather(*[backfill_token(ohlcs, a) for a in backfill_addrs])
@@ -219,6 +228,8 @@ async def fetch_price_updates():
}, },
""" """
addr = t['tokenAddress'] addr = t['tokenAddress']
if addr not in gmx_token_symbol_map:
continue
# GMX prices use 30 decimal places # GMX prices use 30 decimal places
price = (dec(t['minPrice']) + dec(t['maxPrice'])) / 2 * dec(10) ** dec(-30) price = (dec(t['minPrice']) + dec(t['maxPrice'])) / 2 * dec(10) ** dec(-30)
time = from_timestamp(t['timestamp']) time = from_timestamp(t['timestamp'])