diff --git a/conf/finaldata/dexorder-finaldata.toml b/conf/finaldata/dexorder-finaldata.toml index a784184..18f5c34 100644 --- a/conf/finaldata/dexorder-finaldata.toml +++ b/conf/finaldata/dexorder-finaldata.toml @@ -2,4 +2,5 @@ metadata='metadata.json' # mounted from a ConfigMap in the k8s yaml rpc_url = '${rpc_urls.finaldata}' ws_url = '' redis_url = '' -ohlc_dir = '/ohlc' \ No newline at end of file +ohlc_dir = '/ohlc' +walker_flush_interval=25 diff --git a/src/dexorder/bin/finaldata.py b/src/dexorder/bin/finaldata.py index d39a3ed..05be146 100644 --- a/src/dexorder/bin/finaldata.py +++ b/src/dexorder/bin/finaldata.py @@ -42,19 +42,10 @@ async def handle_backfill_uniswap_swaps(swaps: list[EventData]): async def flush_callback(): - # start = now() - # log.info("finalizing OHLC's") - # log.info(f'\ttook {(now() - start).total_seconds():.1f} seconds') - confirms = (config.confirms if config.confirms is not None else current_chain.get().confirms) - 1 chain_id = current_chain.get().id fork = current_fork.get() block = await get_block(fork.height, chain_id=chain_id) time = from_timestamp(block.timestamp) - if latest_block[chain_id].height - fork.height <= 2*confirms: - log.info(f'forward filling to present time') - for addr, data in address_metadata.items(): - if data['type'] == 'Pool' and data['exchange'] >= 0: - ohlcs.update(addr, time, None) log.info("flushing OHLC's") ohlcs.flush() log.info(f'backfill completed through block {block.height} {time:%Y-%m-%d %H:%M:%S} {hexstr(block.hash)}') diff --git a/src/dexorder/ohlc.py b/src/dexorder/ohlc.py index 74bd748..aff0cee 100644 --- a/src/dexorder/ohlc.py +++ b/src/dexorder/ohlc.py @@ -12,7 +12,6 @@ from decimal import InvalidOperation from typing import Optional, NamedTuple, Reversible, Union from cachetools import LFUCache -from typing_extensions import deprecated from dexorder import dec, config, from_timestamp, timestamp, now, minutely from dexorder.base.chain import current_chain