L0vdL0vd

Archive data guides

Read a contract at a past block

Pass the block as the last parameter of eth_call. Example: USDC totalSupply() at block 16,308,190 (Jan 1, 2023).

curl $L0VD_ETHEREUM_URL -H 'Content-Type: application/json' -d '{
  "jsonrpc":"2.0","id":1,"method":"eth_call",
  "params":[{"to":"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","data":"0x18160ddd"},"0xF8D7DE"]
}'

Find the block for a date

There is no RPC method that maps time to block. Binary-search eth_getBlockByNumber on the timestamp field (about 25 requests for Ethereum). The MCP tool block_at_timestamp does this for you.

Backfill events with eth_getLogs

  1. Always filter by address and, when possible, topics.
  2. Query in chunks of blocks instead of the whole chain at once. Start with about 1,000 blocks per request on Ethereum and fewer on fast chains such as Arbitrum or BNB Chain, then adjust to the density of the contract's events. The free test key allows 10 blocks per eth_getLogs request; paid plans don't have this limit.
  3. If a response is too large or times out, halve the range and retry that chunk.
  4. Run chunks in parallel up to your plan's RPS cap. With unlimited-request plans the total cost doesn't depend on how many chunks you send.
for (let from = start; from <= end; from += step) {
  const to = Math.min(from + step - 1, end);
  const logs = await client.getLogs({ address, event, fromBlock: from, toBlock: to });
  await save(logs);
}

Snapshot balances

Batch eth_getBalance or ERC-20 balanceOf calls for many addresses at one block in a single JSON-RPC batch. Pin the block number so every value is from the same state.