A production-ready Envio indexer for tracking PING token transfers and Uniswap V3 pool activity on Base network.
- Token: PING (
0xd85c31854c2B0Fb40aaA9E2Fc4Da23C21f829d46) - Pool: PING-USDC Uniswap V3 (
0xBc51DB8aEC659027AE0B0E468C0735418161A780) - Network: Base (Chain ID: 8453)
- Fee Tier: 0.30% (3000)
- Real-time account balance tracking
- Transfer history with pool-related detection
- Holder count (excludes zero-balance accounts)
- Daily token activity statistics
- New account tracking
- Complete swap event records
- Pool statistics (liquidity, price, volume)
- Multi-decimal support (USDC: 6, PING: 18)
- Daily pool activity aggregation
- Daily token metrics (transfers, volume, active users)
- Daily pool metrics (swaps, volume, liquidity changes)
- Historical trends and analytics
# Install dependencies
pnpm install
# Generate types from config
pnpm codegen# Start local indexer with Hasura
pnpm devVisit http://localhost:8080 to access the GraphQL Playground (password: testing)
query GetToken {
Token(id: "8453_0xd85c31854c2b0fb40aaa9e2fc4da23c21f829d46") {
symbol
name
totalTransfers
totalVolume
holderCount
}
}query LatestSwaps {
Swap(limit: 10, order_by: { timestamp: desc }) {
timestamp
sender
recipient
amount0
amount1
transactionHash
}
}query GetAccount($address: String!) {
Account(id: $address) {
balance
totalSent
totalReceived
transferCount
}
}query DailyActivity {
DailyTokenActivity(limit: 30, order_by: { date: desc }) {
date
dailyTransfers
dailyVolume
dailyActiveAccounts
}
}# Query pool information
pnpm tsx scripts/query-pool-info.ts
# Query token information
node scripts/query-token-info.js
# Run test queries
node scripts/test-queries.js├── config.yaml # Envio configuration
├── schema.graphql # GraphQL schema
├── src/
│ ├── EventHandlers.ts # Event handler registration
│ ├── handlers/
│ │ ├── transfer-handler.ts
│ │ └── swap-handler.ts
│ └── utils/
│ ├── constants.ts # Token/pool constants
│ └── index.ts # Helper functions
└── scripts/ # Utility scripts
Deploy to Envio Hosted Service:
pnpm envio deployTo adapt this indexer for other tokens/pools, update:
- Token metadata in
src/utils/constants.ts - Pool configuration in
src/handlers/swap-handler.ts - Start block in
config.yamlfor faster syncing
This project is licensed under the MIT License.