getPoolQuotes
Read a pool’s quote book from the analytics subgraph.
import { getPoolQuotes, POOL_OPEN_QUOTE_STATUSES } from "@symmio/trading-core";
const { quotes } = await getPoolQuotes(config, {
symbolId: 1,
quoteStatuses: POOL_OPEN_QUOTE_STATUSES,
first: 25,
});This is pool-wide, not account-scoped. The query carries no partyA or partyB filter, so it returns every
trader’s quotes on the market and partyA differs row to row. If you want one account’s quotes, this is the wrong
read — use getSubAccountQuotes.
Rows are scoped by the pool’s symbolId and by source — the SYMMIO diamond the quotes were opened against, which the SDK resolves from the chain’s symmioAddress. Nothing extra to configure.
Which rows you get is the status filter
quoteStatuses takes raw QuoteStatus ordinals, because that is what the subgraph stores and filters on. Two sets are exported for the common cases:
POOL_OPEN_QUOTE_STATUSES([4]) — open on-chain, i.e. live positions. This is what a pool page’s “open quotes” tab shows: one row per position, every trader.POOL_PENDING_QUOTE_STATUSES([0, 2]) — sent but not yet accepted. The default, but short-lived: a solver accepts within seconds, so against a busy market this is usually a small or empty list. Reach for it for a “pending orders” view, not the open book.
Parameters
chainIdnumberoptionalTarget chain id. Defaults to the config’s defaultChainId.
symbolIdnumber | null | undefinedrequiredThe pool’s solver market id. A pool with no symbolId is not tradable and has no book, so the action returns an
empty list without issuing a request and the query factory stays enabled: false.
quoteStatusesreadonly number[]optionalRaw QuoteStatus ordinals to include. Defaults to POOL_PENDING_QUOTE_STATUSES.
firstnumberoptionalPage size. Defaults to 50.
skipnumberoptionalPage offset. Defaults to 0.
orderDirection"asc" | "desc"optionalSort direction on the quote timestamp. Defaults to "desc".
Returns
{ quotes: PoolQuote[] }. Amounts and prices are bigint at 18 decimals — the protocol’s scale, which happens to match the listing backend’s but is a separate thing. null means the subgraph had no value for that field.
idstringSubgraph row id ({quoteId}-{source}); stable, use as a table key.
quoteIdbigintProtocol quote id.
quoteStatusnumber | nullRaw QuoteStatus ordinal.
positionTypenumber | nullRaw PositionType ordinal — 0 long, 1 short.
orderTypeOpennumber | nullRaw OrderType ordinal of the open — 0 limit, 1 market.
symbolstring | nullMarket ticker, when the subgraph carries one.
symbolIdnumber | nullSolver market id.
partyAstringThe account that opened the quote. Varies row to row.
partyBstring | nullThe solver that took the other side.
quantitybigint | nullQuote size.
closedAmountbigint | nullHow much of quantity has been closed.
quantityToClosebigint | nullSize of an in-flight close request.
openedPricebigint | nullPrice the quote actually opened at.
requestedOpenPricebigint | nullPrice the opener asked for.
averageClosedPricebigint | nullSize-weighted average of the closes so far.
closePricebigint | nullPrice of an in-flight close request.
initialOpenedPricebigint | nullOpen price before any modification.
liquidateAmountbigint | nullSize liquidated, when the quote was liquidated.
liquidatePricebigint | nullPrice the liquidation executed at.
timestampnumberBlock timestamp of the last update, Unix seconds.
blockNumberbigintBlock the quote was last updated in.
Throws
UNSUPPORTED_CHAIN/ no analytics subgraph — aSymmError(kind: "config").- A
SymmApiErrorwhen the subgraph request itself fails.
Related
- Pool detail tables — the other four reads.
- React:
usePoolQuotes.