getQuoteHistory
Terminal (close / liquidation) events for a set of sub-accounts’ quotes. Each row is a single immutable QuoteEvent with its per-event metadata snapshot overlaid onto the (otherwise mutable) quote it belongs to — so a quote closed across several partial closes produces several distinct history rows.
import { getQuoteHistory } from "@symmio/trading-core";
const history = await getQuoteHistory(config, {
subAccounts: [subAccount],
first: 100,
});Parameters
subAccountsreadonly Address[]requiredThe accounts whose history to read — a SubAccount and/or its Virtual Accounts. The query filters on the quote’s
subAccount, so pass every account that may own the relevant quotes. An empty array reads nothing.
closeTypeQuoteCloseTypedefault AllClose-type filter: All, Closed (FILL_CLOSE), ForceClosed, EmergencyClosed, AdlClosed, or Liquidated.
firstnumberdefault 50Page size.
skipnumberdefault 0Page offset.
startTimenumberdefault 0Lower bound on the event timestamp (unix seconds).
endTimenumberdefault 2_000_000_000Upper bound on the event timestamp (unix seconds).
orderDirection"asc" | "desc"default descSort direction on the event timestamp.
chainIdnumberoptionalOptional chain override.
Returns
readonly QuoteHistoryRow[]Chronologically ordered history rows. Each is a terminal QuoteEvent (its type is one of the QuoteCloseEventType
values) with the event’s immutable metadata snapshot overlaid onto the quote’s fields, so partial closes read as
separate rows with the amounts they closed. See Unified quotes for the reconciled quote model these
rows decorate.
Query options
import { getQuoteHistoryQueryOptions } from "@symmio/trading-core";
import { useQuery } from "@tanstack/react-query";
useQuery(getQuoteHistoryQueryOptions(config, { subAccounts: [subAccount] }));