Build EVM blockchain data indexers using Ponder (ponder.sh) - an open-source TypeScript framework for indexing smart contract events, transactions, and traces into custom database schemas with type-safe APIs. Use when the user mentions ponder, blockchain/EVM indexing, onchain data pipelines, subgraph replacement, or wants to index smart contract events into a queryable database.
98
99%
Does it follow best practices?
Impact
98%
1.25xAverage score across 5 eval scenarios
Passed
No known issues
An NFT marketplace wants to index an ERC-721 collection on Ethereum mainnet to track current token ownership and per-account statistics. The contract is at 0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d (Bored Ape Yacht Club), deployed at block 12287507.
For each Transfer event, the indexer should:
When an account receives a token, their held count goes up and received count increments. When they send, held count goes down and sent count increments. The account record should be created on first interaction and updated on subsequent ones.
The standard ERC-721 Transfer event:
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId)The team wants to query tokens by current owner and accounts by number of tokens held.
Create a complete Ponder project with:
ponder.config.ts - Contract configurationponder.schema.ts - Schema for transfers, token ownership, and account aggregatessrc/index.ts - Indexing handler with upsert logic for accounts and ownershipsrc/api/index.ts - API setuptsconfig.json - TypeScript configurationpackage.json - Dependenciesabis/ERC721.ts - ABI file.env.local - Environment variablesThe ABI:
[{"type":"event","name":"Transfer","inputs":[{"name":"from","type":"address","indexed":true},{"name":"to","type":"address","indexed":true},{"name":"tokenId","type":"uint256","indexed":true}]}]