Skip to main content

Subgraph

Mo Chain supports The Graph-style indexing via a self-hosted graph-node + IPFS stack. Subgraphs index DEX pools, bridge transfers, and ENS registrations.

note

The subgraph stack is provisioned on multi-node deployments. On a single small testnet box it may be disabled to conserve memory.

Querying a subgraph

query RecentSwaps {
swaps(first: 5, orderBy: timestamp, orderDirection: desc) {
id
amount0
amount1
sender
timestamp
}
}
const res = await fetch('https://graph-testnet.mo.fit/subgraphs/name/dex', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ query: '{ swaps(first:5){ id sender } }' }),
});
console.log(await res.json());

Planned subgraphs

  • dex — V2/V3 pools, swaps, liquidity positions.
  • bridge — lock/mint/burn/unlock events and transfer status.
  • ens.mo registrations, resolver records, ownership transfers.

Next steps