Subgraph
The Graph indexer that materialises every onchain event into a queryable GraphQL API — markets, orders, fills, positions, resolutions, analytics, leaderboards.
The OddMaki subgraph indexes every event from the Diamond into a queryable schema. The SDK's public module wraps it under the hood, but you can also query it directly from any frontend, bot, or backend.
Endpoints
The subgraph is deployed to both networks, available on The Graph's decentralized gateway (production) and on The Graph Studio (rate-limited, fine for development).
| Network | Subgraph ID (gateway) | Studio endpoint |
|---|---|---|
| Base mainnet | CxoYVjELrNCMLopAmVshnfVAie7yH6QZyCSKD3r41XSQ | https://api.studio.thegraph.com/query/1716020/oddmaki-base/version/latest |
| Base Sepolia | DCnd3ozSyvYxRg7kmZYiDWGBiJCe6QHwu8M93jMN1Q3b | https://api.studio.thegraph.com/query/1716020/oddmaki-base-sepolia/version/latest |
For production traffic, query through the decentralized gateway with your own API key — see The Graph API Key setup. The Subgraph IDs are also exported from the SDK as SUBGRAPH_IDS[base.id] and SUBGRAPH_IDS[baseSepolia.id]. When no API key is configured the SDK falls back to the Studio endpoint automatically.
Schema highlights
The subgraph indexes a small set of core entities:
| Entity | What it represents |
|---|---|
Venue | A venue with its fee schedule, access controls, oracle config |
Market | A market with status, outcomes, and links to its resolution + price-market overlay |
PriceMarket | Per-market overlay for Pyth-powered markets (feed, openTime, closeTime, strike, openPriceTime, isStrikeDeferred) |
Order | A resting limit order with side, tick, quantity remaining, status |
Fill | A matched trade with maker/taker, quantity, settlement path |
MarketTrader | Per-(market, trader) positions, P&L, volume |
Question / Assertion | UMA assertion lifecycle data |
FeeEvent | Every fee distribution across the four-layer stack |
The SDK wraps the most-common queries:
const markets = await client.public.getMarkets({ venueId: 1n });
const topOfBook = await client.public.getTopOfBook(marketId);
const trades = await client.public.getTradeHistory({ marketId });
const positions = await client.public.getPositions({ trader: wallet });For arbitrary queries that aren't wrapped, the SubgraphClient exposes a raw request(query, vars):
const { markets } = await client.public.subgraph.request(MY_CUSTOM_QUERY, vars);Source
github.com/oddmaki/oddmaki-subgraph — schema, mapping handlers, and deployment scripts. Indexed events match the ABI exported by the SDK.
Related sections
- Contracts — the onchain addresses the subgraph indexes
- SDK Reference — the
publicmodule's query catalog