CRISP partnersSDK methods

crisp.tradeFills()

Iterate through reconciled trade-fill pages.

An async generator, not an array or a single response. Defaults to a maximum of 100 pages and throws on non-advancing cursors or an exhausted budget. Persist the last cursor to continue.

trading workflow · All SDK methods

Import and runtime

@crisp-trade/partner-sdk — server only; never expose credentials to the browser.

Client setup and shared behavior

Arguments

ArgumentPresenceReleased TypeScript type
userRequired
string
queryRequired
Operations["listTradeFills"]["input"]["query"]
optionsOptional
{
        signal?: AbortSignal;
        maxPages?: number;
    }

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

Example

Example IDs and intent keys are illustrative. Replace them with authenticated account resources and your persisted intent. Browser route names are example routes you implement on your own backend.

// Use a reused, server-only CrispClient (see client setup).
for await (const page of crisp.tradeFills(
  'user-123',
  { from: '2026-09-01T00:00:00Z', to: '2026-09-02T00:00:00Z' },
  { maxPages: 10 },
)) {
  console.log(page.data.fills, page.data.cursor);
}

Returns

Returns an async generator of response pages. Consume with for await…of.

Return type
AsyncGenerator<Response<{
        crispAccountId: string;
        externalUserId: string;
        window: {
            "from": string;
            "to": string;
        };
        fills: Array<{
            "id": string;
            "venue": string;
            "upstreamFillId": string;
            "clobOrderId": string | null;
            "clientOrderId": string | null;
            "matchedAt": string;
            "marketId": string | null;
            "marketTitle": string | null;
            "assetId": string | null;
            "outcome": string | null;
            "side": string | null;
            "price": string | null;
            "shares": string | null;
            "notionalUsdc": string | null;
            "venueFeeUsdc": string | null;
            "venueTransactionHash": string | null;
            "venueStatus": string | null;
            "fee": {
                "collectionId": string;
                "amountUsdc": string;
                "state": "queued" | "submitting" | "submitted" | "settled" | "manual_review";
                "transactionHash": string | null;
                "allocations": Array<{
                    "recipientType": "crisp_revenue" | "partner_treasury" | "referral";
                    "referralLevel": number | null;
                    "beneficiaryAccountId": string | null;
                    "amountUsdc": string;
                    "destinationAddress": string | null;
                    "payout": {
                        "id": string;
                        "state": "queued" | "submitting" | "submitted" | "settled" | "manual_review";
                        "batchAmountUsdc": string;
                        "transactionHash": string | null;
                    } | null;
                }>;
            } | null;
        }>;
        cursor: string | null;
        hasMore: boolean;
    }>, void, unknown>

Errors and lifecycle

Errors and retry policy. Financial uncertainty requires recovery with the original intent, never a new key. Realtime helpers must be stopped on logout/account switch.

Exact released types

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

Full signature
crisp.tradeFills(user: string, query: Operations["listTradeFills"]["input"]["query"], options?: {
        signal?: AbortSignal;
        maxPages?: number;
    }): AsyncGenerator<Response<{
        crispAccountId: string;
        externalUserId: string;
        window: {
            "from": string;
            "to": string;
        };
        fills: Array<{
            "id": string;
            "venue": string;
            "upstreamFillId": string;
            "clobOrderId": string | null;
            "clientOrderId": string | null;
            "matchedAt": string;
            "marketId": string | null;
            "marketTitle": string | null;
            "assetId": string | null;
            "outcome": string | null;
            "side": string | null;
            "price": string | null;
            "shares": string | null;
            "notionalUsdc": string | null;
            "venueFeeUsdc": string | null;
            "venueTransactionHash": string | null;
            "venueStatus": string | null;
            "fee": {
                "collectionId": string;
                "amountUsdc": string;
                "state": "queued" | "submitting" | "submitted" | "settled" | "manual_review";
                "transactionHash": string | null;
                "allocations": Array<{
                    "recipientType": "crisp_revenue" | "partner_treasury" | "referral";
                    "referralLevel": number | null;
                    "beneficiaryAccountId": string | null;
                    "amountUsdc": string;
                    "destinationAddress": string | null;
                    "payout": {
                        "id": string;
                        "state": "queued" | "submitting" | "submitted" | "settled" | "manual_review";
                        "batchAmountUsdc": string;
                        "transactionHash": string | null;
                    } | null;
                }>;
            } | null;
        }>;
        cursor: string | null;
        hasMore: boolean;
    }>, void, unknown>
Response
export interface Response<T> {
    data: T;
    status: number;
    requestId: string;
    retryAfterMs: number | null;
    asOf?: string | null;
    freshness?: string | null;
}
CRISP Partner Documentation