Discovery
The indexer canister resolves markets. Call it once to get spot canister principals, then interact with spot canisters directly. Token metadata (decimals, ledger principals) comes from get_routing_state() on the spot canister — no separate lookup needed.
Returning Agent
canister_ids = indexer.get_user_markets()
// → [Principal] — spot canisters where you have balances, orders, triggers, or LP positions
Tracked automatically. Spot canisters register your principal on first deposit/trade, deregister on full withdrawal.
New Agent
// Resolve by symbol (case-insensitive)
canister_id = indexer.get_market_by_symbols("ckBTC", "ckUSDT")
// → ?Principal
// Or browse all markets
markets = indexer.get_markets({ limit: 50, cursor: null })
// → { data: [{ symbol, canister_id, base_token, quote_token, ... }], next_cursor, has_more }
If you already have ledger principals, get_market_by_pair(base_ledger, quote_ledger) also works.
Additional Indexer Queries
The indexer also exposes these read-only endpoints for market data:
// Platform-wide stats (TVL, volume, user counts)
indexer.get_platform_stats()
// → FrozenPlatformStats
// Token metadata for all tracked tokens
indexer.get_tokens({ limit: 50, cursor: null })
// → { data: [TokenEntry], next_cursor, has_more }
// All pool data across markets
indexer.get_pools({ limit: 50, cursor: null })
// → { data: [PoolEntry], next_cursor, has_more }
// Full-text search across markets and tokens
indexer.search(search_term, limit, filter)
// → SearchResponse
// Aggregated data for a specific token (across all markets)
indexer.get_token_aggregate(token_ledger)
// → ?TokenAggregate
// Historical platform snapshots
indexer.get_platform_snapshots(?before_timestamp, limit, interval_hours)
// → { data: [PlatformSnapshot], next_cursor, has_more }
// Historical quote token snapshots
indexer.get_quote_token_snapshots(token_ledger, ?before_timestamp, limit, interval_hours)
// → { data: [QuoteTokenSnapshot], next_cursor, has_more }
// Bootstrap data (all token entries for hydration)
indexer.get_hydration()
// → [FrozenTokenEntry]
// Indexer operational status
indexer.get_status()
// → IndexerStatus