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
| Field | Type | Required | Description |
|---|---|---|---|
| startTime | Long | Conditional | Inclusive start of the time range, in Unix milliseconds. Required when endTimeis supplied or page is greater than 1. |
| endTime | Long | Conditional | Exclusive end of the time range, in Unix milliseconds. Required when startTime is supplied or page is greater than 1. |
| portfolioId | String | No | ID of the Portfolio to query. Defaults to the Portfolio associated with the API key. |
| page | Integer | No | Page number, starting at 1. Defaults to 1. For page 2 or later, send both time parameters. |
| pageSize | Integer | No | Events per page. Defaults to 20. Allowed range: 1 through 50. |
Portfolio access:
| API key | When portfolioId is omitted | When portfolioId is supplied |
|---|---|---|
| Main API key | The associated Main Portfolio. | The associated Main Portfolio or one of its Sub Portfolios. |
| Sub Portfolio API key | The 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:
| Field | Type | Description |
|---|---|---|
| code | Integer | Business status code. 200000 indicates success. |
| message | String | Text message for the response. |
| data | Object | A page of liquidation events. |
data:
| Field | Type | Description |
|---|---|---|
| page | Integer | Current page number. |
| pageSize | Integer | Effective page size. |
| totalSize | Integer | Total events matching the query. |
| startTime | Long | Effective start of the query, inclusive, in Unix milliseconds. |
| endTime | Long | Effective end of the query, exclusive, in Unix milliseconds. |
| list | Array | Matching events ordered by createAt descending. Events with the same createAt are ordered by liquidationEventId ascending. |
data.list[]:
| Field | Type | Description |
|---|---|---|
| liquidationEventId | String | Liquidation event ID. |
| portfolioId | String | ID of the Portfolio to which the event belongs. |
| exchangeType | String | Exchange on which the event occurred. |
| eventType | String | CANCELLATION (orders cancelled only, no position closed) or POSITION_LIQUIDATION (positions force-closed). |
| createAt | long | Start of the event's first business node, in Unix milliseconds. The query window filters on this value. |
| updateAt | long | Most recent event update time, in Unix milliseconds. |
| triggerUniMmr | Decimal | Unified maintenance margin ratio at the liquidation trigger. Applies to POSITION_LIQUIDATION. |
| totalPositionsLiquidated | Integer | Number of positions force-closed across the whole event. Only present for POSITION_LIQUIDATION. |
| totalClosedPnl | Decimal | Aggregate realized PnL in USDT. A negative value indicates a loss. Applies to POSITION_LIQUIDATION. |
| totalLiqFee | Decimal | Total liquidation fees charged across the event, in USDT. Only present for POSITION_LIQUIDATION. |
| nodes | Array | Recorded node snapshots ordered by node start time, earliest first. |
data.list[].nodes[]:
| Field | Type | Description |
|---|---|---|
| nodeId | Long | Node ID. Preserve its 64-bit integer precision when parsing. |
| nodeType | String | Type 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). |
| roundSeq | Integer | Position-reduction round, starting at 1. Only present on POSITION_REDUCE nodes; the engine may need several rounds to bring the account back. |
| createAt | Long | Node start time, in Unix milliseconds. |
| updateAt | Long | Node completion or latest update time, in Unix milliseconds. |
| account | Object | Account snapshot. The POSITION_LIQUIDATED container node omits this field. |
| assets | Array | Asset snapshots at this node, one entry per coin. Omitted on the POSITION_LIQUIDATED container node. |
| positions | Array | Position snapshots, when available for the node. The array can be empty. |
| orders | Array | Open-order snapshots taken before cancellation. Included when a CANCEL_OPEN_ORDERS or CANCEL_ALL_ORDERS node has order snapshots. |
data.list[].nodes[].account:
| Field | Type | Description |
|---|---|---|
| equity | Decimal | Total account equity on this venue, valued in USDT-equivalent (including cash balance and PnL). |
| uniMmr | Decimal | Unified maintenance margin ratio, calculated as validMargin / maintainMargin. A value of "1" represents 100%. The value is "999999" when there is no maintenance margin requirement. |
| validMargin | Decimal | Effective margin.marginValue - openLossMargin. |
| maintainMargin | Decimal | Minimum margin required across all positions to avoid liquidation. |
| availableMargin | Decimal | Margin available for opening new positions or for withdrawal. |
| upnl | Decimal | Unrealized profit and loss of the account, in USDT. |
| accountStatus | String | Account 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.
| Field | Type | Description |
|---|---|---|
| coin | String | Coin symbol, e.g. USDT, BTC. |
| exchangeType | String | Venue this balance is held on: BINANCE, OKX, EDX. |
| equity | Decimal | Equity of this coin = balance + unrealized PnL from open positions. |
| available | Decimal | Quantity of this coin freely available for trading or transfer. |
| frozen | Decimal | Quantity locked (e.g. in open orders, pending withdrawals, or other holds). |
| borrow | Decimal | Quantity of this coin currently borrowed, where the venue / account type supports borrowing. |
| debt | Decimal | Outstanding borrowed amount of this coin not yet repaid. 0 if nothing is borrowed. |
| price | Decimal | Price of this coin in USDT at the time of the snapshot. |
data.list[].nodes[].positions[]:
| Field | Type | Description |
|---|---|---|
| positionId | String | Internal position ID for this symbol and side within the Portfolio. |
| exchangeType | String | Venue the position is held on: BINANCE, OKX, EDX. |
| sym | String | Unified symbol identifier, e.g. BINANCE_PERP_BTC_USDT. |
| positionSide | String | Position side: NONE in one-way mode, LONG or SHORT in hedge mode. |
| positionQty | Decimal | Position quantity. Positive = long, negative = short. Unit varies by venue: contracts on OKX, base currency on BINANCE. |
| positionValue | Decimal | Market value of the position (mark price × quantity). |
| markPrice | Decimal | Mark price at the snapshot. |
| unrealizedPnl | Decimal | Unrealized profit or loss on this position at this node, in USDT. |
| positionMode | String | Position mode on this venue: NET (one-way) or BOTH (dual-side). |
| leverage | Integer | Leverage applied to this position at the time. |
| closedQty | Decimal | The 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. |
| closedPnl | Decimal | The 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. |
| liqFee | Decimal | Liquidation 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.
| Field | Type | Description |
|---|---|---|
| orderId | String | Order ID. |
| exchangeType | String | Venue the order was placed on: BINANCE, OKX, EDX. |
| sym | String | Unified symbol identifier, e.g. BINANCE_PERP_BTC_USDT. |
| side | String | Order side: BUY or SELL. |
| orderType | String | Order type: LIMIT or MARKET. |
| price | Decimal | Order price. 0 for market orders. |
| orderQty | Decimal | Order quantity. Unit varies by venue: contracts on OKX, base currency on BINANCE. |
| orderState | String | State the order was in when the snapshot was taken, e.g. NEW, PARTIALLY_FILLED. |
| reduceOnly | Boolean | Indicates 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"
}
]
}
]
}
]
}
}
