ponder-indexer-events

Maintain Ponder event handlers and Postgres projections for on-chain game events.

Updated Jul 28, 2026
One-click install
npx skills add https://github.com/IagoPrandi/zeroclaw-plugin --skill ponder-indexer-events-iagoprandi
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ponder-indexer-events
Source: https://github.com/IagoPrandi/zeroclaw-plugin/tree/main/.claude/skills/ponder-indexer-events
Command: npx skills add https://github.com/IagoPrandi/zeroclaw-plugin --skill ponder-indexer-events-iagoprandi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Keeping a blockchain indexer in sync with evolving smart contracts is error-prone: missed events, non-idempotent handlers, and schema drift silently corrupt the data your API and UI depend on. This Skill provides a structured workflow for maintaining Ponder event coverage and Postgres projections so every on-chain event is handled, projected, and queryable. ## Core Features & Use Cases - Event Coverage Checklist: Defines the minimum required event set across turn lifecycle, participation, shop, draw, payout, and resource domains so nothing is missed when contracts change. - Projection Integrity Rules: Enforces idempotent keys (txHash, logIndex), upsert semantics for player/day/month entities, and consistent derived fields like phase status and remaining stock. - End-to-End Change Workflow: Guides the full pipeline from ABI regeneration through Ponder handlers, dbmate migrations, Kysely typings, and replay/reorg testing. - Use Case: After adding a new RelicBought event to your game contracts, use this Skill to regenerate the ABI, write the handler, add the migration, update API types, and verify with duplicate-replay tests. ## Quick Start Ask the AI to add Ponder handler coverage and a Postgres projection for a newly added contract event, following the change workflow and testing checklist.

Frequently Asked Questions about ponder-indexer-events

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new event handler in Ponder?▼

Regenerate the ABI from the contracts build artifacts, then add or update the Ponder handler for the new event. Follow with a dbmate migration, updated Kysely typings, and a handler unit test plus a duplicate-replay test.

How to make blockchain event indexing idempotent?▼

Use the composite key (txHash, logIndex) for every event row so replays and reorgs never create duplicates. Upsert player, day, and month entities by creating them if missing and updating them if they already exist.

What database migrations work with Ponder indexers?▼

This workflow uses dbmate for schema migrations, applied after handler changes so the DB schema supports the queries the UI and API need. Kysely typings keep API types aligned with the migrated schema.

How do I test Ponder event handlers against reorgs?▼

Write a handler unit test for each new or changed event, a replay test for duplicates, and a reorg sanity test where feasible. Add a snapshot test for the API response shape to catch projection drift.

When should I use materialized views for leaderboard queries?▼

Prefer read models such as views or materialized views for leaderboard queries so API responses remain explainable by the DB schema and underlying events. This keeps derived data consistent with the indexed event stream.