read_multicall_historical_stateful
Documentation for eth_defi.event_reader.multicall_batcher.read_multicall_historical_stateful function.
- read_multicall_historical_stateful(chain_id, web3factory, calls, start_block, end_block, step, max_workers=8, timeout=1800, display_progress=True, progress_suffix=None, require_multicall_result=False, chunk_size=48, hypersync_client=None, timestamp_cache_file=PosixPath('/home/runner/.tradingstrategy/block-timestamp'), rpc_request_stats=None)
Read historical data using multicall with reading state and adaptive frequency filtering.
Allow adaptive frequency with read state
Slower loop than the dumb
read_multicall_historical()as it has to maintain stateBecause of state, we need to do block by block reading, as we need to evaluate state to see which calls are needed for which block, and the state depends on the result of the previous blocks
- Parameters
chunk_size –
We guarantee to update the reader state at least this many steps.
24 = 24h hours per day, assuming we update state once for every day data read.
Between chunks we blindly push data to subprocesses for speedup, do not attempt to hear back from the multiprocess to update the state.
chain_id (int) –
web3factory (eth_defi.event_reader.web3factory.Web3Factory) –
calls (dict[eth_defi.event_reader.multicall_batcher.EncodedCall, eth_defi.event_reader.multicall_batcher.BatchCallState]) –
start_block (int) –
end_block (int) –
step (int) –
hypersync_client (HypersyncClient | None) –
timestamp_cache_file (pathlib.Path) –
rpc_request_stats (Optional[eth_defi.provider.rpcdb.RPCRequestStats]) –
- Return type
Iterable[eth_defi.event_reader.multicall_batcher.CombinedEncodedCallResult]