Skip to Content
Symmio Trading-SDK — the SDK surface for builders on Arbitrum
CoreSubgraphgetLiquidationDetails

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

sourceAddressoptional

The deployment’s diamond address (the subgraph’s source).

partyAsreadonly Address[]optional

The liquidated accounts (partyA) — a SubAccount, or a Virtual Account under Virtual Account isolation.

startTimenumberoptional

Lower bound on liquidationTimestamp (unix seconds, inclusive).

endTimenumberoptional

Upper bound on liquidationTimestamp (unix seconds, inclusive).

firstnumberdefault 1000

Page size, 1–1000.

skipnumberdefault 0

Rows to skip. The Graph rejects values above 5000.

orderBy"timestamp" | "id"default timestamp

Sort field. "timestamp" sorts on liquidationTimestamp. Defaults to "id" when idGt is set.

orderDirection"asc" | "desc"default desc

Sort direction. Defaults to "asc" when idGt is set.

idGtstringoptional

Cursor: 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.

chainIdnumberoptional

Optional chain override.

Returns

GetLiquidationDetailsReturnType
rowsLiquidationDetailRow[]

The decoded liquidations of this page.

hasMoreboolean

true 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.

LiquidationDetailRow
idstring

Subgraph entity id — stable; use it as a row key or idGt cursor.

sourceAddress

Diamond address the liquidation was indexed from.

partyAAddress

The liquidated account.

liquidationIdbigint

Protocol liquidation id.

liquidationTypenumber

Protocol liquidation type, as indexed.

liquidationTimestampnumber

When the liquidation started, unix seconds.

timestampnumber | null

Entity timestamp, unix seconds.

lockedCvabigint | null

CVA locked when the liquidation started.

lockedLfbigint | null

LF locked when the liquidation started.

lockedPartyAmmbigint | null

PartyA maintenance margin locked when the liquidation started.

paidCvabigint | null

CVA paid out by the liquidation.

paidLfbigint | null

LF paid out by the liquidation.

upnlbigint

The account’s uPnL at liquidation.

deficitbigint

Deficit left by the liquidation.

liquidationFeebigint

Liquidation fee.

settledboolean

Whether the liquidation has been settled.

fullyLiquidatedboolean

Whether every position was liquidated.

settlementExpectedAmountsbigint[] | null

Settlement amounts expected per PartyB.

settlementActualAmountsbigint[] | null

Settlement 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.

Last updated on