getSubgraphQuotes
The analytics subgraph’s Quote entities, as indexed. Reach for it when you need what the subgraph tracks per quote — the funding index and last payment time, the settled funding totals, the lifecycle timestamps — for many quotes in one request, or for quotes long closed.
import { getSubgraphQuotes } from "@symmio/trading-core";
const { rows, hasMore } = await getSubgraphQuotes(config, {
quoteIds: [7334n],
source: diamond,
});Indexed, not live. These rows are the subgraph’s copy of each quote, and they lag the chain. For the live on-chain
struct read getQuote; for the reconciled quote a trading UI renders, see Unified
quotes.
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.
Parameters
quoteIdsreadonly bigint[]optionalOn-chain quote ids. Pass source with them when one subgraph indexes several diamonds, whose quote ids can collide.
sourceAddressoptionalThe deployment’s diamond address (the subgraph’s source).
partyAsreadonly Address[]optionalOwning accounts (partyA).
firstnumberdefault 1000Page size, 1–1000.
skipnumberdefault 0Rows to skip. The Graph rejects values above 5000.
orderBy"timestamp" | "id"default timestampSort field. "timestamp" is the entity timestamp. Defaults to "id" when idGt is set.
orderDirection"asc" | "desc"default descSort direction. Defaults to "asc" when idGt is set.
idGtstringoptionalCursor: only quotes 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.
chainIdnumberoptionalOptional chain override.
Returns
GetSubgraphQuotesReturnTyperowsSubgraphQuoteRow[]The decoded quotes of this page.
hasMorebooleantrue when the page came back full, so another page may exist.
SubgraphQuoteRow
Amounts and prices are 18-decimal wei bigint. A null marks a field the subgraph has not indexed for this quote — never read it as zero.
SubgraphQuoteRowidstringSubgraph entity id, <quoteId>-<source> — use it as an idGt cursor.
sourceAddressDiamond address the quote was indexed from.
quoteIdbigintOn-chain quote id.
quoteStatusQuoteStatus | nullLifecycle status.
partyAAddressPartyA — the SubAccount or Virtual Account.
partyBAddress | nullPartyB, the solver.
symbolIdnumber | nullMarket id.
symbolstring | nullMarket ticker.
positionTypePositionType | nullLong or short.
quantitybigint | nullQuote quantity.
fillAmountbigint | nullFilled quantity.
closedAmountbigint | nullQuantity closed so far.
openedPricebigint | nullCurrent open price.
accumulatedPaidFundingbigint | nullFunding index the quote has paid through — signed, and an index, not an amount. See Funding.
lastFundingPaymentTimestampnumber | nullLast funding payment, unix seconds.
userPaidFundingbigint | nullCumulative funding PartyA paid.
userReceivedFundingbigint | nullCumulative funding PartyA received.
timestampSendQuotenumber | nullWhen the quote was sent, unix seconds.
timestampOpenPositionnumber | nullWhen the position opened, unix seconds.
timestampFullyClosenumber | nullWhen the position fully closed, unix seconds.
timestampnumberEntity timestamp, unix seconds.
blockNumberbigintBlock number of the last update.
Query options
import { getSubgraphQuotesQueryOptions } from "@symmio/trading-core";
import { useQuery } from "@tanstack/react-query";
useQuery(getSubgraphQuotesQueryOptions(config, { quoteIds: [7334n], source: diamond }));The query is disabled while quoteIds or partyAs is an empty array.
Related
getQuote— the live on-chain struct.getQuoteFunding— just the settled funding totals, withmissingQuoteIdsfor indexing lag.getQuoteFundingSettlements— each settlement that moved those totals.- React
useSubgraphQuotes— the hook over this action.