Skip to main content

Indexer Canister API Reference

Canister ID: gx3we-baaaa-aaaab-afaia-cai

The Indexer canister aggregates and serves market discovery data for the PartyDEX platform. It operates on a push model: spot canisters push their state when it changes, and the Indexer serves pre-aggregated data to frontends. It stores hourly snapshots for historical charting and tracks user-market involvement for portfolio resolution.

info

For complete method signatures and type definitions, refer to the Candid interface file (indexer.did).

Try It

Public Query Endpoints

All query endpoints are unauthenticated and read-only.

get_markets

Returns a paginated list of spot markets sorted by 24h volume (descending). Server-side limit cap: 1000 results per page.

get_market_by_pair

Look up a spot market canister by base and quote token ledger principals. Returns the spot canister principal, or null if no market exists for the pair.

get_market_by_symbols

Look up a spot market canister by token symbols (e.g., "BOOM", "ICP"). Case-insensitive. Primary endpoint for URL-based market resolution (e.g., /trade/BOOM/ICP). Returns the spot canister principal, or null if not found.

get_pools

Returns a paginated list of AMM pools sorted by 24h volume (descending).

get_tokens

Returns a paginated list of tokens sorted by 24h volume (descending). Each token entry includes aggregated metrics across all markets where it appears.

get_token_aggregate

Returns aggregated TVL and volume for a single token across all markets it appears in. Computed on-demand. Pass the token's ledger principal. Returns null if the token has no registered markets.

Search markets and tokens by symbol or name. Minimum 2-character search term required; returns empty results below that. Results sorted by 24h volume descending. The filter parameter controls which categories to include (all, tokens, or markets).

get_platform_stats

Returns platform-wide aggregate statistics including TVL, cumulative volume, fees, entity counts, and rolling 24h values.

get_platform_snapshots

Returns historical platform snapshots at configurable hourly intervals. Snapshots are stored hourly; wider intervals are computed by differencing fence posts. On initial queries (no cursor), a live trailing bar for the current incomplete period is appended.

before_timestamp is the pagination cursor in milliseconds (null for latest). interval_hours sets bar width -- typical values: 1 (1D chart), 24 (1M chart), 168 (1Y chart). Bars are returned newest-first. Volume, fees, and transaction counts are period deltas; TVL and entity counts are point-in-time at bar end.

get_quote_token_snapshots

Returns historical snapshots for a quote token (ICP, ckUSDT, or ckUSDC), aggregated across all markets where that token appears. On initial queries (no cursor), a live trailing bar is appended. Same pagination and interval semantics as get_platform_snapshots. Only supported for quote tokens with snapshot tracking; returns empty for other tokens.

get_hydration

Returns all registered tokens with basic metadata (ledger principal, symbol, name, decimals). Intended for initial frontend hydration.

get_user_markets

Returns all spot canister principals where the caller has involvement (balances, orders, LP positions). Authenticated by caller identity. Used to determine which markets to query for a user's portfolio.

get_status

Returns basic indexer status: market, pool, and token counts plus last push timestamp.

get_control

Returns the current canister configuration (admin set, treasury, cycles threshold, system state, timer status).

Numeric Precision

All USD-denominated values use fixed-point encoding:

SuffixPrecisionRangeUsage
_e1212 decimalsFull Nat rangePrices
_e66 decimalsNat or Nat64TVL, volume, fees
_bpsBasis pointsInt (signed)Price changes (1 bp = 0.01%)
_pipsParts per millionNat32Fee tiers (100 = 0.01%)

Timestamps are Unix time in milliseconds (Nat64).