Add onchain/script/backtesting/fetch-events.ts — a tsx script that: - Fetches Swap/Mint/Burn events from a Uniswap V3 pool via Infura (Base mainnet) - Batches eth_getLogs in 2 000-block chunks with 100 ms inter-batch delay - Decodes each log with viem and writes one JSON Line per event - Supports resume: reads last block from existing cache file on re-run - Retries with exponential back-off on 429 / rate-limit errors - Prints per-batch progress: "Fetching blocks X-Y... N events (B/T batches)" Also adds package.json, tsconfig.json, and cache/.gitkeep. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
16 lines
280 B
JSON
16 lines
280 B
JSON
{
|
|
"name": "backtesting",
|
|
"version": "0.0.1",
|
|
"type": "module",
|
|
"scripts": {
|
|
"fetch": "tsx fetch-events.ts"
|
|
},
|
|
"dependencies": {
|
|
"viem": "^2.22.13"
|
|
},
|
|
"devDependencies": {
|
|
"@types/node": "^24.0.0",
|
|
"tsx": "^4.19.0",
|
|
"typescript": "^5.7.0"
|
|
}
|
|
}
|