Order History
Query Order History
Query user's historical order records.
HTTP Request
GET
/api/perp-trade-api/history/orders
Request Frequency Restriction:
- Recommended: no more than 10 times per second
Authentication Required:
- JWT Token required
- X-Wallet-Address header required
Request Headers
| Name | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | JWT Token, format: Bearer {token} |
| X-Wallet-Address | string | Yes | Wallet address |
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| symbol | string | No | Trading pair, e.g., ETH-PERP, if not provided, query all trading pairs |
| pageNum | integer | No | Page number, default is 1 |
| pageSize | integer | No | Page size, default is 20 |
| beginTime | long | No | Start time (milliseconds), default is 7 days ago |
| endTime | long | No | End time (milliseconds) |
Response Fields Description
Returns paginated response, containing:
| Name | Type | Description |
|---|---|---|
| total | long | Total number of records |
| pageNum | integer | Current page number |
| pageSize | integer | Page size |
| list | array | Order list |
Each order contains:
| Name | Type | Description |
|---|---|---|
| id | long | Order ID |
| clientId | string | Client ID |
| orderStatus | string | Order status |
| orderHash | string | Order hash |
| symbol | string | Trading pair |
| orderType | string | Order type |
| creator | string | User address |
| side | string | Trading direction |
| price | string | Price |
| quantity | string | Quantity |
| leverage | string | Leverage |
| avgPrice | string | Average fill price |
| filledQuantity | string | Filled quantity |
| filledFee | string | Filled fee |
| realizedPnl | string | Realized profit/loss |
| createdAt | long | Creation time (milliseconds) |
| updatedAt | long | Update time (milliseconds) |
| entryPrice | string | Entry average price (if this order has close) |
| closeQuantity | string | Closed quantity (if this order has close) |
| triggerConditionType | string | Trigger condition type |
| triggerPrice | string | Trigger price |
| triggerDirection | integer | Trigger direction |
| reduceOnly | boolean | Whether reduce-only |
| planOrderType | string | Plan order type |
Response Example
{
"code": 200,
"message": "success",
"data": {
"total": 100,
"pageNum": 1,
"pageSize": 20,
"list": [
{
"id": 123456,
"clientId": "my-order-001",
"orderStatus": "FILLED",
"orderHash": "0xabc123...",
"symbol": "ETH-PERP",
"orderType": "LIMIT",
"creator": "0xab7f6e97232d633689cf762989455cceb769587c69a9f09a23f537f5605f9e78",
"side": "BUY",
"price": "2500",
"quantity": "1",
"leverage": "5",
"avgPrice": "2500",
"filledQuantity": "1",
"filledFee": "1.25",
"realizedPnl": "5",
"createdAt": 1700000000000,
"updatedAt": 1700000100000,
"reduceOnly": false,
"planOrderType": "open"
}
]
}
}