Indexer Client

The Strike indexer provides REST endpoints for querying aggregated market state. Use it for startup snapshots — fetching all markets, orderbook levels, and open positions. For live data, use event streaming.

API v1

All indexer endpoints are available under the /v1/ prefix. The legacy unprefixed routes remain for backward compatibility but new integrations should use /v1/.

Responses use a standard envelope: { data: [...], meta: { total, limit, offset } }. The SDK handles this transparently — callers receive plain Vec<Market>, Vec<IndexerOrder>, etc. with no change to existing code.

For wallet position endpoints, the SDK also normalizes known schema drift across legacy and v1 payloads. Filled and redeemable entries preserve the raw JSON but expose stable accessors like factory_market_id(), orderbook_market_id(), redeemable(), resolved(), and lots_hint().

Canonical OpenAPI Reference

The generated OpenAPI spec is the source of truth for the public indexer API:

If this page and the OpenAPI spec ever disagree, trust the generated spec.

Get Markets

get_markets() fetches all markets from the indexer:

let client = StrikeClient::new(StrikeConfig::bsc_mainnet()).build()?;

let markets = client.indexer().get_markets().await?;

for market in &markets {
    println!(
        "factory {} | orderbook {:?} | expiry: {} | interval: {}s | status: {}",
        market.factory_market_id,
        market.orderbook_market_id,
        market.expiry_time,
        market.batch_interval,
        market.status,
    );
}

get_active_markets() filters for active markets client-side:

Pagination (direct HTTP)

If you query the indexer directly (without the SDK), the /v1/markets endpoint supports pagination:

Parameter
Type
Default
Description

status

string

Filter by status (active, closed, resolving, resolved, cancelled)

limit

int

50

Max results per page

offset

int

0

Number of results to skip

since

int

Unix timestamp; return markets created after this time

Response:

Market Type

Use factory_market_id for lifecycle/resolution flows and orderbook_market_id for trading. The legacy id field is kept for backward compatibility and still maps to the factory market ID.

Get Orderbook

Fetch aggregated bid/ask levels for a market:

OrderbookSnapshot Type

Get Open Orders

Fetch open orders for a wallet address:

The v1 response from /v1/positions/:address is paginated:

The SDK handles both the v1 paginated and legacy flat-array formats automatically — get_open_orders always returns Vec<IndexerOrder>.

Get Wallet Positions

Fetch the full wallet snapshot from /positions/:address:

get_positions() returns:

Use the accessor methods on IndexerFilledPosition instead of relying on a specific upstream JSON shape.

Get Redeemable Positions

Fetch the wallet's redeem backlog from /positions/:address/redeemable:

This is the right discovery path before calling on-chain redemption. The SDK normalizes both paginated and legacy redeemable payloads, including nested and casing-drifted field names.

IndexerOrder Type

Trades

The /v1/markets/:id/trades endpoint returns cleared batches for a market, filtering out empty batches by default. This endpoint is available via direct HTTP — the SDK does not wrap it yet.

Stats

The /v1/stats endpoint returns aggregate protocol statistics (total volume, active markets, etc.). This endpoint is available via direct HTTP — the SDK does not wrap it yet.

Configuration

The indexer URL is set in StrikeConfig with a default for each network. Override it with the builder:

Indexer errors return StrikeError::Indexer.

Last updated