Compare commits
2 Commits
eef803d3d6
...
a4a2f6e318
| Author | SHA1 | Date | |
|---|---|---|---|
| a4a2f6e318 | |||
| 97f98ba7cf |
@@ -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'])
|
||||||
|
|||||||
Reference in New Issue
Block a user