On-chain event indexer for the indexing agreement lifecycle in The Graph protocol.
This subgraph tracks the full lifecycle of Direct Indexing Payments (DIPs) agreements on-chain. It indexes events emitted by the SubgraphService contract through the IndexingAgreement library and exposes them via a GraphQL API that downstream services can query.
Dipper is the primary consumer -- its chain listener polls this subgraph to detect when indexers accept or cancel agreements, keeping its internal state in sync with on-chain reality without direct RPC polling.
IndexingAgreementAccepted | Indexer accepts an RCA on-chain, creating an allocation |
IndexingAgreementCanceled | Agreement canceled by payer or indexer |
IndexingAgreementUpdated | Agreement terms or allocation changed |
IndexingFeesCollectedV1 | Fees collected against an active agreement |
graph LR
A[SubgraphService<br>Contract] -->|emits events| B[graph-node]
B -->|indexes| C[GraphQL API]
C -->|polls| D[dipper<br>chain_listener]
D -->|updates| E[(agreement<br>state)]
style A fill:#6747ED,stroke:#5438c5,color:#fff
style B fill:#1a1a2e,stroke:#333,color:#fff
style C fill:#1a1a2e,stroke:#333,color:#fff
style D fill:#2d6a4f,stroke:#1b4332,color:#fff
style E fill:#2d6a4f,stroke:#1b4332,color:#fff
npm install
npm run prepare:hardhat # generate manifest from template
npx graph codegen # generate AssemblyScript types
npx graph build # compile to WASM
npm test # matchstick unit tests (Linux only)Each network has a config file in config/ with the contract address and start block.
# 1. Generate manifest for target network
npm run prepare:hardhat
# 2. Create and deploy
npx graph create --node http://localhost:8020 indexing-payments
npx graph deploy --node http://localhost:8020 --ipfs http://localhost:5001 \
--version-label v0.1.0 indexing-paymentsAvailable networks
| Network | Config | SubgraphService Address |
|---|---|---|
| Hardhat (local) | config/hardhat.json |
0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9 |
| Arbitrum One | config/arbitrum-one.json |
TBD |
| Arbitrum Sepolia | config/arbitrum-sepolia.json |
TBD |