updated finaldata for arbsep
This commit is contained in:
1
conf/finaldata/metadata-finaldata.json
Normal file
1
conf/finaldata/metadata-finaldata.json
Normal file
@@ -0,0 +1 @@
|
||||
{"421614":{"t":[{"a":"0xC285286254318d1dFC9D58F55C3910d8E28e19B4","n":"Wrapped Ether","s":"WETH","d":18,"x":{"mock":true}},{"a":"0x1feCc53911C2fFeC5B12b805C5b49bE60bB544fF","n":"USD Coin","s":"USDC","d":6,"x":{"mock":true}}],"p":[{"a":"0xe6022A376189734F3Cd6Cd63872b7649A00294d8","b":"0x1feCc53911C2fFeC5B12b805C5b49bE60bB544fF","q":"0xC285286254318d1dFC9D58F55C3910d8E28e19B4","f":500,"e":1,"d":-12,"x":{"data":{"uri":"https://beta.dexorder.trade/ohlc/","chain":42161,"symbol":"0xC6962004f452bE9203591991D15f6b388e09E8D0","inverted":true}}}]}}
|
||||
@@ -25,7 +25,7 @@ log = logging.getLogger('dexorder.backfill')
|
||||
|
||||
async def finalize_callback(fork: Fork, diffs: Reversible[Union[DiffItem, DiffEntryItem]]):
|
||||
ohlc_save(fork, diffs)
|
||||
ts = await get_block_timestamp(fork.head, fork.height)
|
||||
ts = await get_block_timestamp(fork.head)
|
||||
log.info(f'backfill completed through block {fork.height} {from_timestamp(ts):%Y-%m-%d %H:%M:%S}')
|
||||
|
||||
|
||||
|
||||
@@ -29,9 +29,9 @@ ohlcs = FinalOHLCRepository()
|
||||
|
||||
async def handle_backfill_uniswap_swaps(swaps: list[EventData]):
|
||||
# asynchronously prefetch the block timestamps we'll need
|
||||
block_ids = set((swap['blockHash'], swap['blockNumber']) for swap in swaps)
|
||||
block_ids = set(swap['blockHash'] for swap in swaps)
|
||||
for batch in itertools.batched(block_ids, 4):
|
||||
await asyncio.gather(*[get_block_timestamp(h,n) for h, n in batch])
|
||||
await asyncio.gather(*[get_block_timestamp(h) for h in batch])
|
||||
|
||||
# now execute the swaps synchronously
|
||||
for swap in swaps:
|
||||
|
||||
@@ -135,9 +135,9 @@ async def handle_transfer(transfer: EventData):
|
||||
|
||||
async def handle_uniswap_swaps(swaps: list[EventData]):
|
||||
# asynchronously prefetch the block timestamps we'll need
|
||||
block_ids = set((swap['blockHash'], swap['blockNumber']) for swap in swaps)
|
||||
block_ids = set(swap['blockHash'] for swap in swaps)
|
||||
for batch in itertools.batched(block_ids, 4):
|
||||
await asyncio.gather(*[get_block_timestamp(h,n) for h, n in batch])
|
||||
await asyncio.gather(*[get_block_timestamp(h) for h in batch])
|
||||
|
||||
# now execute the swaps synchronously
|
||||
for swap in swaps:
|
||||
|
||||
@@ -377,7 +377,7 @@ class OHLCRepository:
|
||||
root_branch = current_blockstate.get().root_branch
|
||||
root_hash = root_branch.head
|
||||
if root_hash is not None:
|
||||
root_timestamp = await get_block_timestamp(root_hash, root_branch.height)
|
||||
root_timestamp = await get_block_timestamp(root_hash)
|
||||
oldest_needed = from_timestamp(root_timestamp) - period
|
||||
# noinspection PyTypeChecker
|
||||
trim = (oldest_needed - historical[0].start) // period
|
||||
|
||||
@@ -118,6 +118,6 @@ async def get_uniswap_data(swap: EventData) -> Optional[tuple[OldPoolDict, datet
|
||||
if pool['exchange'] != Exchange.UniswapV3.value:
|
||||
return None
|
||||
price: dec = await uniswap_price(pool, sqrt_price)
|
||||
timestamp = await get_block_timestamp(swap['blockHash'], swap['blockNumber'])
|
||||
timestamp = await get_block_timestamp(swap['blockHash'])
|
||||
dt = from_timestamp(timestamp)
|
||||
return pool, dt, price
|
||||
|
||||
Reference in New Issue
Block a user