Skip to Content
Symmio Trading-SDK — the SDK surface for builders on Arbitrum
CoreSubgraphgetFundingIndexCheckpoints

getFundingIndexCheckpoints

The funding-rate index of one market and PartyB at points in time, from the analytics subgraph’s fundingIndexCheckpoints collection. Each checkpoint is written by an event (eventType) and records the raw and current long / short rates, the accumulated rate index, the epoch configuration, and the fee snapshots. Reach for it to find the index a quote’s funding was measured against at a given moment, or as one of the raw inputs of a per-epoch funding timeline.

import { getFundingIndexCheckpoints } from "@symmio/trading-core"; const { rows, hasMore } = await getFundingIndexCheckpoints(config, { marketIds: [42], partyBs: [solver], startTime: openedAt, orderDirection: "asc", });

Every filter is optional and applied only when passed; an empty list filter reads nothing. One call returns one page — see Filters and paging for the shared rules and for paging by cursor.

The checkpoint in force at a moment

The latest checkpoint at or before a moment is one row: bound the time from above with endTime, sort newest first, and take one.

const { rows } = await getFundingIndexCheckpoints(config, { source: diamond, marketIds: [42], partyBs: [solver], endTime: openedAt, orderDirection: "desc", first: 1, }); const checkpoint = rows[0]; // undefined when none was written before `openedAt`

Parameters

sourceAddressoptional

The deployment’s diamond address (the subgraph’s source).

marketIdsreadonly number[]optional

Market ids (symbolId).

partyBsreadonly Address[]optional

PartyB (solver) addresses.

startTimenumberoptional

Lower bound on the block timestamp (unix seconds, inclusive).

endTimenumberoptional

Upper bound on the block timestamp (unix seconds, inclusive).

firstnumberdefault 1000

Page size, 1–1000.

skipnumberdefault 0

Rows to skip. The Graph rejects values above 5000.

orderBy"timestamp" | "id"default timestamp

Sort field. Defaults to "id" when idGt is set.

orderDirection"asc" | "desc"default desc

Sort direction. Defaults to "asc" when idGt is set.

idGtstringoptional

Cursor: only checkpoints whose id sorts after this one. Sorts by id ascending unless a sort is passed; any other sort throws INVALID_SUBGRAPH_CURSOR. See Paging by cursor.

chainIdnumberoptional

Optional chain override.

Returns

GetFundingIndexCheckpointsReturnType
rowsFundingIndexCheckpointRow[]

The decoded checkpoints of this page.

hasMoreboolean

true when the page came back full, so another page may exist.

FundingIndexCheckpointRow

Rates and fees are 18-decimal bigint, passed through as indexed. A null marks a field the subgraph has not indexed for this checkpoint — never read it as zero.

FundingIndexCheckpointRow
idstring

Subgraph entity id — stable; use it as a row key or idGt cursor.

sourceAddress

Diamond address the checkpoint was indexed from.

symbolIdnumber

Market id.

partyBAddress

PartyB, the solver.

eventTypestring

The event that wrote the checkpoint, as indexed.

rawLongRatebigint | null

Raw long rate, before the market-price conversion.

rawShortRatebigint | null

Raw short rate, before the market-price conversion.

marketPricebigint | null

Market price the rates were converted at.

currentLongRatebigint | null

Current long rate.

currentShortRatebigint | null

Current short rate.

accumulatedLongRatebigint | null

Accumulated long rate — the index.

accumulatedShortRatebigint | null

Accumulated short rate — the index.

epochDurationbigint | null

Epoch length, seconds.

lastUpdatedEpochbigint | null

Last updated epoch.

startEpochbigint | null

First epoch.

startEpochTimestampnumber | null

First epoch’s start, unix seconds.

snapshotLongFeebigint | null

Long fee snapshot.

snapshotShortFeebigint | null

Short fee snapshot.

timestampnumber

Block timestamp, unix seconds.

blockNumberbigint

Block number.

transactionHex

Transaction hash.

Query options

import { getFundingIndexCheckpointsQueryOptions } from "@symmio/trading-core"; import { useQuery } from "@tanstack/react-query"; useQuery(getFundingIndexCheckpointsQueryOptions(config, { marketIds: [42], partyBs: [solver] }));

The query is disabled while marketIds or partyBs is an empty array.

Last updated on