CRISP partnersSDK methods

getPolymarketOrderBook()

Read a public order-book snapshot.

Unsigned read directly from Polymarket CLOB using an outcome token ID. Uncached, no automatic retries. Returns data, source, fetchedAt and stale. Display data does not authorize trading. See the guide for units and errors.

market-discovery workflow · All SDK methods

Import and runtime

@crisp-trade/partner-sdk/discovery — public Polymarket reads from your backend; no CRISP credentials or signing.

Client setup and shared behavior

Arguments

ArgumentPresenceReleased TypeScript type
tokenIdRequired
string
optionsOptional
DiscoveryRequest

Named types are expanded under “Exact released types” below. Parameters are in call order; optional does not imply nullable.

Example

Public display read. Replace example slugs or search text with your selected discovery inputs.

import { getPolymarketOrderBook } from '@crisp-trade/partner-sdk/discovery';
const result = await getPolymarketOrderBook('123');
console.log(result.data.bids, result.data.asks);

Returns

The exact return type is shown below; this helper does not use the ordinary HTTP response wrapper.

Return type
Promise<DiscoveryResult<PolymarketOrderBook>>

Errors and lifecycle

Discovery errors, cache and cancellation. Public reads use PolymarketDiscoveryError, not CrispApiError. No order is submitted.

Direct Polymarket sources. These reads are not CRISP HMAC operations.

Exact released types

Extracted from the shipped SDK 0.13.0, not separately maintained signatures.

Full signature
getPolymarketOrderBook(tokenId: string, options?: DiscoveryRequest): Promise<DiscoveryResult<PolymarketOrderBook>>
DiscoveryRequest
export interface DiscoveryRequest {
    signal?: AbortSignal;
}
DiscoveryResult
export interface DiscoveryResult<T> {
    data: T;
    source: string;
    fetchedAt: string;
    stale: boolean;
}
PolymarketOrderBook
export interface PolymarketOrderBook {
    conditionId: string;
    tokenId: string;
    timestamp: string;
    hash: string | null;
    bids: Array<{
        price: string;
        size: string;
    }>;
    asks: Array<{
        price: string;
        size: string;
    }>;
    minOrderSize: string | null;
    tickSize: string | null;
    negRisk: boolean | null;
    lastTradePrice: string | null;
}
CRISP Partner Documentation