Liquidation Event List

Retrieve a paginated list of liquidation events for a Portfolio over a time range. Use this endpoint to review liquidation history or retrieve events that occurred while your WebSocket client was disconnected. Each result includes an event summary and the available snapshots for each recorded step, including account, asset, position, and pre-cancellation order data.Omit all query parameters to retrieve the first page of events from the preceding 48 hours for the Portfolio associated with your API key. The default page size is 20. To specify a time range, provide both startTime and endTime.

Permission

  • Applies to both primary user and trading portfolio's API Key.
  • Permission: READ.

Rate Limit

  • 20 requests per 60 seconds.

Request Parameters

FieldTypeRequiredDescription
startTimeLongConditionalInclusive start of the time range, in Unix milliseconds. Required when endTimeis supplied or page is greater than 1.
endTimeLongConditionalExclusive end of the time range, in Unix milliseconds. Required when startTime is supplied or page is greater than 1.
portfolioIdStringNoID of the Portfolio to query. Defaults to the Portfolio associated with the API key.
pageIntegerNoPage number, starting at 1. Defaults to 1. For page 2 or later, send both time parameters.
pageSizeIntegerNoEvents per page. Defaults to 20. Allowed range: 1 through 50.

Portfolio access:

API keyWhen portfolioId is omittedWhen portfolioId is supplied
Main API keyThe associated Main Portfolio.The associated Main Portfolio or one of its Sub Portfolios.
Sub Portfolio API keyThe associated Sub Portfolio.Only the Sub Portfolio associated with the key.

Time window:

  • On page 1, omitting both time parameters selects the preceding 48 hours relative to the current server time.
  • For an explicit time range, provide positive Unix millisecond timestamps with startTime < endTime. The range can span up to 7 days. startTime must be within the preceding 90 days, and endTime must be at or before the current server time.
  • An event matches when startTime <= createAt < endTime. The event's createAt is the start time of its first recorded liquidation step. Snapshots from subsequent steps may fall outside the requested time range.

Response Fields

Top-level:

FieldTypeDescription
codeIntegerBusiness status code. 200000 indicates success.
messageStringText message for the response.
dataObjectA page of liquidation events.

data:

FieldTypeDescription
pageIntegerCurrent page number.
pageSizeIntegerEffective page size.
totalSizeIntegerTotal events matching the query.
startTimeLongEffective start of the query, inclusive, in Unix milliseconds.
endTimeLongEffective end of the query, exclusive, in Unix milliseconds.
listArrayMatching events ordered by createAt descending. Events with the same createAt are ordered by liquidationEventId ascending.

data.list[]:

FieldTypeDescription
liquidationEventIdStringLiquidation event ID.
portfolioIdStringID of the Portfolio to which the event belongs.
exchangeTypeStringExchange on which the event occurred.
eventTypeStringCANCELLATION (orders cancelled only, no position closed) or POSITION_LIQUIDATION (positions force-closed).
createAtlongStart of the event's first business node, in Unix milliseconds. The query window filters on this value.
updateAtlongMost recent event update time, in Unix milliseconds.
triggerUniMmrDecimalUnified maintenance margin ratio at the liquidation trigger. Applies to POSITION_LIQUIDATION.
totalPositionsLiquidatedIntegerNumber of positions force-closed across the whole event. Only present for POSITION_LIQUIDATION.
totalClosedPnlDecimalAggregate realized PnL in USDT. A negative value indicates a loss. Applies to POSITION_LIQUIDATION.
totalLiqFeeDecimalTotal liquidation fees charged across the event, in USDT. Only present for POSITION_LIQUIDATION.
nodesArrayRecorded node snapshots ordered by node start time, earliest first.

data.list[].nodes[]:

FieldTypeDescription
nodeIdLongNode ID. Preserve its 64-bit integer precision when parsing.
nodeTypeStringType of liquidation step. Examples include CANCEL_OPEN_START, CANCEL_ALL_START, LIQUIDATING_START, CANCEL_ALL_ORDERS, POSITION_REDUCE, and COMPLETED. A completed node can have a suffix, as in COMPLETED(ASSET_SALE).
roundSeqIntegerPosition-reduction round, starting at 1. Only present on POSITION_REDUCE nodes; the engine may need several rounds to bring the account back.
createAtLongNode start time, in Unix milliseconds.
updateAtLongNode completion or latest update time, in Unix milliseconds.
accountObjectAccount snapshot. The POSITION_LIQUIDATED container node omits this field.
assetsArrayAsset snapshots at this node, one entry per coin. Omitted on the POSITION_LIQUIDATED container node.
positionsArrayPosition snapshots, when available for the node. The array can be empty.
ordersArrayOpen-order snapshots taken before cancellation. Included when a CANCEL_OPEN_ORDERS or CANCEL_ALL_ORDERS node has order snapshots.

data.list[].nodes[].account:

FieldTypeDescription
equityDecimalTotal account equity on this venue, valued in USDT-equivalent (including cash balance and PnL).
uniMmrDecimalUnified maintenance margin ratio, calculated as validMargin / maintainMargin. A value of "1" represents 100%. The value is "999999" when there is no maintenance margin requirement.
validMarginDecimalEffective margin.marginValue - openLossMargin.
maintainMarginDecimalMinimum margin required across all positions to avoid liquidation.
availableMarginDecimalMargin available for opening new positions or for withdrawal.
upnlDecimalUnrealized profit and loss of the account, in USDT.
accountStatusStringAccount status at this node: NORMAL (back within margin requirements), LIQUIDATION (liquidation in progress), TAKEOVER (position taken over ).

data.list[].nodes[].assets[]:

One entry per coin held on the venue at this node.

FieldTypeDescription
coinStringCoin symbol, e.g. USDT, BTC.
exchangeTypeStringVenue this balance is held on: BINANCE, OKX, EDX.
equityDecimalEquity of this coin = balance + unrealized PnL from open positions.
availableDecimalQuantity of this coin freely available for trading or transfer.
frozenDecimalQuantity locked (e.g. in open orders, pending withdrawals, or other holds).
borrowDecimalQuantity of this coin currently borrowed, where the venue / account type supports borrowing.
debtDecimalOutstanding borrowed amount of this coin not yet repaid. 0 if nothing is borrowed.
priceDecimalPrice of this coin in USDT at the time of the snapshot.

data.list[].nodes[].positions[]:

FieldTypeDescription
positionIdStringInternal position ID for this symbol and side within the Portfolio.
exchangeTypeStringVenue the position is held on: BINANCE, OKX, EDX.
symStringUnified symbol identifier, e.g. BINANCE_PERP_BTC_USDT.
positionSideStringPosition side: NONE in one-way mode, LONG or SHORT in hedge mode.
positionQtyDecimalPosition quantity. Positive = long, negative = short. Unit varies by venue: contracts on OKX, base currency on BINANCE.
positionValueDecimalMarket value of the position (mark price × quantity).
markPriceDecimalMark price at the snapshot.
unrealizedPnlDecimalUnrealized profit or loss on this position at this node, in USDT.
positionModeStringPosition mode on this venue: NET (one-way) or BOTH (dual-side).
leverageIntegerLeverage applied to this position at the time.
closedQtyDecimalThe historical cumulative closed quantity for the position. This is a position-level cumulative value, not the quantity closed at this node, and is not directly related to this node. Unit varies by venue: contracts on OKX, base currency on BINANCE.
closedPnlDecimalThe historical cumulative realized PnL of the position. This is a position-level cumulative value, not the realized PnL generated at this node, and is unrelated to this node, in USDT.
liqFeeDecimalLiquidation fee charged for this position at this node, in USDT.

data.list[].nodes[].orders[]:

Snapshots of the open orders cancelled by this node, as they were immediately before cancellation.

FieldTypeDescription
orderIdStringOrder ID.
exchangeTypeStringVenue the order was placed on: BINANCE, OKX, EDX.
symStringUnified symbol identifier, e.g. BINANCE_PERP_BTC_USDT.
sideStringOrder side: BUY or SELL.
orderTypeStringOrder type: LIMIT or MARKET.
priceDecimalOrder price. 0 for market orders.
orderQtyDecimalOrder quantity. Unit varies by venue: contracts on OKX, base currency on BINANCE.
orderStateStringState the order was in when the snapshot was taken, e.g. NEW, PARTIALLY_FILLED.
reduceOnlyBooleanIndicates whether the order can only reduce a position.

Example Response

{
  "code": 200000,
  "message": "Success",
  "data": {
    "page": 1,
    "pageSize": 20,
    "totalSize": 1,
    "startTime": 1795584868796,
    "endTime": 1795757668796,
    "list": [
      {
        "liquidationEventId": "9000000000000001",
        "portfolioId": "9000000000000101",
        "exchangeType": "BINANCE",
        "eventType": "POSITION_LIQUIDATION",
        "createAt": 1795587267373,
        "updateAt": 1795588089273,
        "triggerUniMmr": "0.97611617033486610500",
        "totalPositionsLiquidated": 1,
        "totalClosedPnl": "0.034",
        "totalLiqFee": "0.243",
        "nodes": [
          {
            "nodeId": 9000000000000301,
            "nodeType": "LIQUIDATING_START",
            "createAt": 1795587267373,
            "updateAt": 1795587267373,
            "account": {
              "equity": "10.200596669450716357",
              "uniMmr": "0.97611617033486610500",
              "validMargin": "9.94555269075944844808",
              "maintainMargin": "10.1889027075",
              "availableMargin": "-4.98792480924055155193",
              "upnl": "0.035955",
              "accountStatus": "LIQUIDATING"
            },
            "assets": [
              {
                "coin": "USDT",
                "exchangeType": "BINANCE",
                "equity": "10.200596669450716357",
                "available": "10.164641669450716357",
                "frozen": "0",
                "borrow": "0",
                "debt": "0",
                "price": "1"
              }
            ],
            "positions": [
              {
                "positionId": "90000000000000201",
                "exchangeType": "BINANCE",
                "sym": "BINANCE_PERP_DOT_USDT",
                "positionSide": "NONE",
                "positionQty": "20",
                "positionValue": "12.961955",
                "markPrice": "0.64809775",
                "unrealizedPnl": "0.035955",
                "positionMode": "NET",
                "leverage": 2,
                "closedQty": "0",
                "closedPnl": "0",
                "liqFee": "0"
              }
            ]
          },
          {
            "nodeId": 9000000000000302,
            "nodeType": "CANCEL_ALL_ORDERS",
            "createAt": 1795587267662,
            "updateAt": 1795587267662,
            "account": {
              "equity": "10.200596669450716357",
              "uniMmr": "0.98624747705524995100",
              "validMargin": "9.94556879075944844808",
              "maintainMargin": "10.0842527075",
              "availableMargin": "3.46459129075944844808",
              "upnl": "0.035955",
              "accountStatus": "LIQUIDATING"
            },
            "assets": [
              {
                "coin": "USDT",
                "exchangeType": "BINANCE",
                "equity": "10.200596669450716357",
                "available": "10.164641669450716357",
                "frozen": "0",
                "borrow": "0",
                "debt": "0",
                "price": "1"
              }
            ],
            "positions": [
              {
                "positionId": "90000000000000201",
                "exchangeType": "BINANCE",
                "sym": "BINANCE_PERP_DOT_USDT",
                "positionSide": "NONE",
                "positionQty": "20",
                "positionValue": "12.961955",
                "markPrice": "0.64809775",
                "unrealizedPnl": "0.035955",
                "positionMode": "NET",
                "leverage": 2,
                "closedQty": "0",
                "closedPnl": "0",
                "liqFee": "0"
              }
            ]
          },
          {
            "nodeId": 9000000000000303,
            "nodeType": "POSITION_REDUCE",
            "roundSeq": 1,
            "createAt": 1795587268055,
            "updateAt": 1795587268055,
            "account": {
              "equity": "9.955628709450716357",
              "uniMmr": "0.97067379917144484400",
              "validMargin": "9.70673799171444844808",
              "maintainMargin": "10",
              "availableMargin": "9.70673799171444844808",
              "upnl": "0",
              "accountStatus": "LIQUIDATING"
            },
            "assets": [
              {
                "coin": "USDT",
                "exchangeType": "BINANCE",
                "equity": "9.955628709450716357",
                "available": "9.955628709450716357",
                "frozen": "0",
                "borrow": "0",
                "debt": "0",
                "price": "1"
              }
            ],
            "positions": [
              {
                "positionId": "90000000000000202",
                "exchangeType": "BINANCE",
                "sym": "BINANCE_PERP_DOT_USDT",
                "positionSide": "NONE",
                "positionQty": "0",
                "positionValue": "0",
                "markPrice": "0.64809775",
                "unrealizedPnl": "0",
                "positionMode": "NET",
                "leverage": 2,
                "closedQty": "0",
                "closedPnl": "0",
                "liqFee": "0"
              }
            ]
          },
          {
            "nodeId": 9000000000000304,
            "nodeType": "COMPLETED(ASSET_SALE)",
            "createAt": 1795588089273,
            "updateAt": 1795588089273,
            "account": {
              "equity": "9.955628709450716357",
              "uniMmr": "999999.00000000000000000000",
              "validMargin": "9.70673799171444844808",
              "maintainMargin": "0",
              "availableMargin": "9.70673799171444844808",
              "upnl": "0",
              "accountStatus": "NORMAL"
            },
            "assets": [
              {
                "coin": "USDT",
                "exchangeType": "BINANCE",
                "equity": "9.955628709450716357",
                "available": "9.955628709450716357",
                "frozen": "0",
                "borrow": "0",
                "debt": "0",
                "price": "1"
              }
            ]
          }
        ]
      }
    ]
  }
}
Response

Language
LoadingLoading…
Response
Choose an example:
application/json