A 1:1 Envio HyperIndex port of the Dolomite liquidator subgraph
(../dolomite-liquidator-subgraph). It indexes the Dolomite margin protocol
(margin accounts, per-token balances, market risk params, and async
deposits/withdrawals) across all supported chains in a single multichain indexer,
so it can serve as a drop-in GraphQL endpoint via the subgraph query converter.
Three contracts per chain — DolomiteMargin, Expiry, EventEmitterRegistry —
across Ethereum (1), Arbitrum One (42161), Base (8453), Mantle (5000),
Polygon zkEVM (1101), Berachain (80094), X-Layer (196).
Addresses and start blocks live in config.yaml.
- Lowercase ids.
address_format: lowercasematches the subgraph'stoHexString()ids byte-for-byte. ${chainId}-id prefix. This is one multichain indexer and several chains reuse the same contract/user addresses, so every entity id is namespaced by chain to avoid collisions. This is the only deviation from the subgraph's literal ids; the query converter scopes per chain.- RPC via Effects. Token metadata (name/symbol/decimals, with bytes32 fallbacks
and DGD/AAVE overrides) and the initial risk params are read over RPC through the
Effect API (
src/effects.ts) — HyperSync cannot read contract state. Set an RPC url per chain (ENVIO_RPC_URL_<chainId>in.env). - Array fields.
borrowTokens/supplyTokens/expirationTokens/allUpdateTransactionsare stored as[String!]!(arrays of entity ids), because Envio only allows entity arrays via@derivedFrom. Same values, but they resolve as id strings rather than nested objects — note this for the converter. - Preserved subgraph quirks (for exact parity):
LogRemoveMarketincrementsnumberOfMarkets;minBorrowedValueis divided by 1e18 twice;LogRemoveMarketdeletesMarketRiskInfobut not the reverse map.
config.yaml— chains, contracts, events (events-only ABIs inabis/*.events.json).schema.graphql— the 10 entities.src/effects.ts— viem RPC reads.src/handlers/helpers.ts— BigDecimal helpers, id builders, getOrCreate helpers.src/handlers/{DolomiteMargin,Expiry,EventEmitterRegistry}.ts— event handlers.src/indexer.test.ts— handler tests (createTestIndexer).
pnpm codegen # regenerate types after editing config.yaml / schema.graphql
pnpm test # run handler tests
pnpm dev # run locally (needs Docker + RPC urls in .env)Visit http://localhost:8080 for the GraphQL playground (local password testing).
- Node.js v22+ (v24 recommended)
- pnpm v10+
- Docker or Podman
- An RPC endpoint per chain (
ENVIO_RPC_URL_<chainId>) — see.env.example.