Multichain Envio HyperIndex indexer for Mento v3 — Celo Mainnet (42220) and Monad Mainnet (143). Tracks FPMM pool activity, oracle health, trading limits, and rebalancer liveness.
Listens to on-chain events from Mento v3 contracts and writes structured entities to Postgres, exposed via Hasura GraphQL.
| Contract | Events |
|---|---|
| FPMMFactory | FPMMDeployed |
| FPMM (pool) | Swap, Mint, Burn, UpdateReserves, Rebalanced, TradingLimitConfigured, LiquidityStrategyUpdated |
| VirtualPool | Swap, Mint, Burn, UpdateReserves, Rebalanced |
| VirtualPoolFactory | VirtualPoolDeployed, PoolDeprecated |
| SortedOracles | OracleReported, MedianUpdated, ReportExpirySet, TokenReportExpirySet |
| OpenLiquidityStrategy | PoolAdded, PoolRemoved, LiquidityMoved, RebalanceCooldownSet |
| ERC20FeeToken | Transfer (dynamically registered from FPMMDeployed events) |
| Entity | Description |
|---|---|
Pool |
Per-pool state: reserves, health, oracle, trading limits, rebalancer liveness |
PoolSnapshot |
Hourly aggregates: volume, TVL, swap count |
OracleSnapshot |
Per-oracle-event: price, deviation, health status |
TradingLimit |
Per-pool per-token: limit state, netflow, pressure ratio |
SwapEvent |
Individual swap: amounts in/out, txHash, timestamp |
LiquidityEvent |
Mint/burn events |
ReserveUpdate |
Reserve snapshots on every UpdateReserves |
RebalanceEvent |
Per-rebalance: improvement, effectiveness ratio |
FactoryDeployment |
Pool creation events from factory |
VirtualPoolLifecycle |
VirtualPool deploy/deprecate events |
OlsPool |
Open Liquidity Strategy pool registrations |
OlsLiquidityEvent |
OLS liquidity movements |
ProtocolFeeTransfer |
ERC20 fee token transfers |
All entity IDs are namespaced by chain: {chainId}-{address} (e.g. 42220-0x02fa..., 143-0xd0e9...).
This prevents collisions when the same contract address is deployed on multiple chains.
| File | Networks |
|---|---|
config.multichain.mainnet.yaml |
Celo Mainnet + Monad (default) |
config.celo.sepolia.yaml |
Celo Sepolia (testnet) |
config.monad.testnet.yaml |
Monad Testnet |
Deploy branch: envio → triggers hosted reindex on push.
- Node.js 22 LTS
- pnpm 10.x
- Docker Desktop (runs Postgres + Hasura locally)
cp indexer-envio/.env.example indexer-envio/.env
# Set ENVIO_RPC_URL_42220 and ENVIO_RPC_URL_143
# Generate types + start multichain indexer
pnpm indexer:codegen && pnpm indexer:devHasura console: http://localhost:8080 (admin secret: testing)
GraphQL endpoint: http://localhost:8080/v1/graphql
pnpm indexer:codegen # Generate types (multichain — Celo + Monad mainnet)
pnpm indexer:dev # Start local multichain indexer
pnpm indexer:celo-sepolia:codegen # Generate types for Celo Sepolia testnet
pnpm indexer:celo-sepolia:dev # Start local Celo Sepolia indexer
pnpm indexer:monad-testnet:codegen # Generate types for Monad Testnet
pnpm indexer:monad-testnet:dev # Start local Monad Testnet indexer
pnpm deploy:indexer # Push to envio branch → triggers hosted reindexpnpm codegen # Generate types
pnpm dev # Start indexer stack
pnpm start # Start without codegen
pnpm stop # Stop Docker containersSee schema.graphql for the full entity model.
Key design decisions:
PoolSnapshotuses hourly buckets (forward-fill for charts is done in the dashboard)TradingLimithas composite ID:{poolId}-{tokenAddress}- All BigInt fields use string representation in GraphQL responses
Recent swaps:
query RecentSwaps {
SwapEvent(limit: 20, order_by: { blockTimestamp: desc }) {
id
chainId
poolId
amount0In
amount1In
amount0Out
amount1Out
txHash
blockTimestamp
}
}Pool health state:
query PoolHealth {
Pool {
id
chainId
token0
token1
healthStatus
oracleOk
priceDifference
rebalanceThreshold
limitStatus
limitPressure0
limitPressure1
rebalanceLivenessStatus
}
}Push to the envio branch to trigger a hosted reindex:
pnpm deploy:indexerThe mento project on Envio Cloud watches this branch. The static production endpoint never changes on redeploy:
https://indexer.hyperindex.xyz/2f3dd15/v1/graphql
See STATUS.md for current sync state and endpoint details.
| File | Purpose |
|---|---|
schema.graphql |
Entity model |
src/EventHandlers.ts |
Event → entity mapping |
src/helpers.ts |
makePoolId, poolIdToAddress utilities |
src/rpc.ts |
RPC read helpers (per-chain clients) |
config.multichain.mainnet.yaml |
Production config (Celo + Monad) |
config/deployment-namespaces.json |
Vendored namespace map for hosted builds |
abis/ |
Contract ABIs |