The problem
A backtest needs pool states and swap events across months of blocks, often re-run with new parameters.
How archive RPC helps
- Swap events with eth_getLogs over long ranges.
- Pool reserves and slot0 with eth_call at each block you test.
- Re-run a backtest without paying per request again.
Methods you will call
- eth_getLogsReturns all logs (events) that match a filter over a block range.
- eth_callExecutes a read-only contract call against the state of a given block, without sending a transaction.
- eth_getBlockByNumberReturns a block by number.
- erigon_getBlockByTimestampReturns the block closest to a Unix timestamp. The fastest way to turn a date into a block number.
Example
Uniswap v2 reserves at a block (web3.py)
pair = w3.eth.contract(address=PAIR, abi=PAIR_ABI)
reserves = pair.functions.getReserves().call(block_identifier=18_908_895)Which plan
Growth for regular research; Scale for large parameter sweeps. See pricing or how it compares.