getLiquidationDetails
One entity per PartyA liquidation, from the analytics subgraph’s liquidationDetails collection: the CVA, LF, and maintenance margin locked when it started, the CVA and LF it paid out, the account’s uPnL, deficit, and liquidation fee, and the settlement amounts per PartyB. Reach for it to explain a liquidated position — what the account lost and where it went.
import { getLiquidationDetails } from "@symmio/trading-core";
const { rows, hasMore } = await getLiquidationDetails(config, {
source: diamond,
partyAs: [virtualAccount],
});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.
Time means liquidationTimestamp here. startTime, endTime, and orderBy: "timestamp" all use the moment the
liquidation started, not the entity’s own timestamp.
Parameters
sourceAddressoptionalThe deployment’s diamond address (the subgraph’s source).
partyAsreadonly Address[]optionalThe liquidated accounts (partyA) — a SubAccount, or a Virtual Account under Virtual Account isolation.
startTimenumberoptionalLower bound on liquidationTimestamp (unix seconds, inclusive).
endTimenumberoptionalUpper bound on liquidationTimestamp (unix seconds, inclusive).
firstnumberdefault 1000Page size, 1–1000.
skipnumberdefault 0Rows to skip. The Graph rejects values above 5000.
orderBy"timestamp" | "id"default timestampSort field. "timestamp" sorts on liquidationTimestamp. Defaults to "id" when idGt is set.
orderDirection"asc" | "desc"default descSort direction. Defaults to "asc" when idGt is set.
idGtstringoptionalCursor: only liquidations 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
GetLiquidationDetailsReturnTyperowsLiquidationDetailRow[]The decoded liquidations of this page.
hasMorebooleantrue when the page came back full, so another page may exist.
LiquidationDetailRow
Amounts are 18-decimal wei bigint. A null marks a field the subgraph has not indexed for this liquidation — never read it as zero.
LiquidationDetailRowidstringSubgraph entity id — stable; use it as a row key or idGt cursor.
sourceAddressDiamond address the liquidation was indexed from.
partyAAddressThe liquidated account.
liquidationIdbigintProtocol liquidation id.
liquidationTypenumberProtocol liquidation type, as indexed.
liquidationTimestampnumberWhen the liquidation started, unix seconds.
timestampnumber | nullEntity timestamp, unix seconds.
lockedCvabigint | nullCVA locked when the liquidation started.
lockedLfbigint | nullLF locked when the liquidation started.
lockedPartyAmmbigint | nullPartyA maintenance margin locked when the liquidation started.
paidCvabigint | nullCVA paid out by the liquidation.
paidLfbigint | nullLF paid out by the liquidation.
upnlbigintThe account’s uPnL at liquidation.
deficitbigintDeficit left by the liquidation.
liquidationFeebigintLiquidation fee.
settledbooleanWhether the liquidation has been settled.
fullyLiquidatedbooleanWhether every position was liquidated.
settlementExpectedAmountsbigint[] | nullSettlement amounts expected per PartyB.
settlementActualAmountsbigint[] | nullSettlement amounts actually paid per PartyB.
Query options
import { getLiquidationDetailsQueryOptions } from "@symmio/trading-core";
import { useQuery } from "@tanstack/react-query";
useQuery(getLiquidationDetailsQueryOptions(config, { source: diamond, partyAs: [virtualAccount] }));The query is disabled while partyAs is an empty array.
Related
getQuoteHistory—closeType: QuoteCloseType.Liquidatedlists the liquidated quotes themselves.- Margin & risk — the liquidation test the account failed.
- React
useLiquidationDetails— the hook over this action.