getPoolTradeHistory
Read a pool’s realized trade history from the analytics subgraph.
import { getPoolTradeHistory } from "@symmio/trading-core";
const { rows } = await getPoolTradeHistory(config, { symbolId: 1, first: 25 });Pool-wide, not account-scoped: no partyA filter, so these are every trader’s closes on the market. The
account-scoped counterpart is getQuoteHistory, which filters by the accounts you
pass. Reaching for the wrong one gives an empty table or someone else’s trades.
One row per close event, not per quote
Rows come from the immutable quoteEvents collection with each event’s frozen metadata snapshot overlaid. A quote closed across three partial closes therefore yields three rows, each showing the size and price of that close rather than the quote’s final state.
That makes summing the rows correct, and makes reading a single row as “the quote” wrong.
Parameters
chainIdnumberoptionalTarget chain id. Defaults to the config’s defaultChainId.
symbolIdnumber | null | undefinedrequiredThe pool’s solver market id. Absent means the pool is not tradable, so the action returns an empty result without
issuing a request and the query factory stays enabled: false.
closeTypeQuoteCloseTypeoptionalClose-type filter. Defaults to QuoteCloseType.All.
firstnumberoptionalPage size. Defaults to 50.
skipnumberoptionalPage offset. Defaults to 0.
orderDirection"asc" | "desc"optionalSort direction on the event timestamp. Defaults to "desc".
Returns
{ rows: QuoteHistoryRow[] } — the same row type as getQuoteHistory, decoded by the same mapper, so a history table can render either read without branching.
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:
usePoolTradeHistory.