Get Open Orders
Retrieve all currently open orders for the authenticated subaccount. This endpoint returns only active orders (not filled or cancelled), with optional filtering by symbol, side, type, and status.
Endpoint
POST https://papi.synthetix.io/v1/tradeRequest
Request Format
{
"params": {
"action": "getOpenOrders",
"subAccountId": "1867542890123456789",
"symbol": "BTC-USDT",
"limit": 50,
"offset": 0
},
"nonce": 1704067200000,
"signature": {
"v": 28,
"r": "0x19480589384695193600abcdef19480589384695193600abcdef19480589384695193600abcdef19480589384695193600abcdef",
"s": "0xabcdef19480589384695193600abcdef19480589384695193600abcdef19480589384695193600abcdef19480589384695193600"
}
}Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
params | object | Yes | Request parameters wrapper |
params.action | string | Yes | Must be "getOpenOrders" |
params.subAccountId | string | Yes | SubAccount ID to retrieve orders for |
params.symbol | string | No | Filter orders by specific market symbol (e.g., "BTC-USDT") |
params.side | string | No | Filter by order side: "buy" or "sell" |
params.type | string | No | Filter by order type (e.g., "LIMIT", "MARKET") |
params.status | string | No | Filter by order status (e.g., "NEW", "PARTIALLY_FILLED") |
params.limit | integer | No | Maximum number of orders to return (default: 50) |
params.offset | integer | No | Number of orders to skip for pagination (default: 0) |
| Parameter | Type | Required | Description |
|---|---|---|---|
nonce | uint64 | Yes | Unix milliseconds timestamp (must be monotonically increasing) |
signature | object | Yes | EIP-712 signature object |
expiresAfter | uint64 | No | Unix milliseconds expiration timestamp (5x rate limit on stale cancels) |
Response
Response Structure
| Field | Type | Description |
|---|---|---|
status | string | Always "ok" for successful requests or "error" for failures |
response | array | Array of open order objects matching filter criteria (omitted when status is "error") |
error | object | Error details (only present when status is "error") |
request_id | string | Request tracking identifier |
timestamp | string | RFC3339 timestamp |
Success Response
{
"status": "ok",
"response": [
{
"orderId": "1958787130134106112",
"symbol": "BTC-USDT",
"side": "buy",
"type": "LIMIT",
"quantity": "0.1",
"price": "45000.00",
"triggerPrice": "",
"triggerPriceType": "",
"timeInForce": "GTC",
"reduceOnly": false,
"postOnly": false,
"closePosition": false,
"createdTime": 1755846234,
"updatedTime": 1755846234,
"filledQuantity": "0.0",
"takeProfitOrderId": "1958787130134106115",
"stopLossOrderId": "1958787130134106116",
"closePosition": false
},
{
"orderId": "1958787130134106113",
"symbol": "ETH-USDT",
"side": "sell",
"type": "limit",
"quantity": "2.0",
"price": "2800.00",
"triggerPrice": "",
"triggerPriceType": "",
"timeInForce": "GTC",
"reduceOnly": false,
"postOnly": true,
"closePosition": false,
"createdTime": 1755846235,
"updatedTime": 1755846235,
"filledQuantity": "0.5",
"takeProfitOrderId": "",
"stopLossOrderId": "",
"closePosition": false
}
],
"request_id": "5ccf215d37e3ae6d",
"timestamp": "2025-01-01T00:00:00Z"
}Empty Result
{
"status": "ok",
"response": [],
"request_id": "5ccf215d37e3ae6f",
"timestamp": "2025-01-01T00:00:00Z"
}Order Object Fields
| Field | Type | Description |
|---|---|---|
orderId | string | Unique order identifier (uint64 as string) |
symbol | string | Trading pair symbol (e.g., "BTC-USDT") |
side | string | Order side: "buy" or "sell" |
type | string | Order type (e.g., "LIMIT", "MARKET") |
quantity | string | Total order quantity |
price | string | Order price (empty for market orders) |
triggerPrice | string | Trigger price for conditional orders |
triggerPriceType | string | Trigger price type: "mark", "last", or "index" |
timeInForce | string | Time in force: "GTC", "IOC", or "FOK" |
reduceOnly | boolean | Whether order can only reduce position |
postOnly | boolean | Whether order must be maker (no immediate match) |
closePosition | boolean | Whether order closes entire position |
createdTime | integer | Order creation timestamp (Unix seconds) |
updatedTime | integer | Last update timestamp (Unix seconds) |
filledQuantity | string | Quantity that has been filled |
takeProfitOrderId | string | ID of linked take-profit order (present on entry orders when using TP/SL grouping, empty string otherwise) |
stopLossOrderId | string | ID of linked stop-loss order (present on entry orders when using TP/SL grouping, empty string otherwise) |
Note on TP/SL Fields: When orders are placed with normalTpsl or positionTpsl grouping, the entry order will contain takeProfitOrderId and stopLossOrderId linking to the associated TP/SL trigger orders. The TP/SL trigger orders themselves will have these fields as empty strings or may reference each other in the grouping.
Error Response
{
"status": "error",
"error": {
"code": "INVALID_FORMAT",
"message": "Invalid request body"
},
"request_id": "5ccf215d37e3ae6d",
"timestamp": "2025-01-01T00:00:00Z"
}Usage Examples
Get All Open Orders
{
"params": {
"action": "getOpenOrders",
"subAccountId": "1867542890123456789"
},
"nonce": 1704067200000,
"signature": { "v": 28, "r": "0x...", "s": "0x..." }
}Get Open Orders for Specific Market
{
"params": {
"action": "getOpenOrders",
"subAccountId": "1867542890123456789",
"symbol": "BTC-USDT"
},
"nonce": 1704067200000,
"signature": { "v": 28, "r": "0x...", "s": "0x..." }
}Get Open Buy Orders with Pagination
{
"params": {
"action": "getOpenOrders",
"subAccountId": "1867542890123456789",
"side": "buy",
"limit": 100,
"offset": 0
},
"nonce": 1704067200000,
"signature": { "v": 28, "r": "0x...", "s": "0x..." }
}Implementation Notes
- Returns only active orders (placed, partially filled)
- Does not include filled, cancelled, or rejected orders
- For historical orders with time ranges and status filters, use
getOrdersHistory - Pagination uses limit/offset approach (default limit: 50)
- Orders are returned in creation order (newest first)
- Authentication requires signature by account owner or authorized delegate
- Linked TP/SL orders:
takeProfitOrderIdandstopLossOrderIdcontain order IDs when orders are grouped with TP/SL
Signing
All trading methods are signed using EIP-712. Each successful trading request will contain:
- A piece of structured data that includes the sender address
- A signature of the hash of that structured data, signed by the sender
For detailed information on EIP-712 signing, see EIP-712 Signing.
Nonce Management
The nonce system prevents replay attacks and ensures order uniqueness:
- Use current timestamp in milliseconds as nonce
- Each nonce must be greater than the previous one
- Recommended: Use
Date.now()or equivalent - If nonce conflicts occur, increment by 1 and retry
Error Handling
Common error scenarios:
| Error | Description |
|---|---|
| Invalid signature | EIP-712 signature validation failed |
| Invalid market symbol | Market symbol not recognized |
| Nonce already used | Nonce must be greater than previous value |
| Rate limit exceeded | Too many requests in time window |
| Request expired | expiresAfter timestamp has passed |
| Error | Description |
|---|---|
| Invalid request format | Request payload could not be parsed |
| Internal error | Failed to retrieve orders |
| Subaccount not found | Specified subaccount does not exist |
| Invalid symbol | Specified symbol is not recognized |
| Invalid pagination | Limit or offset out of valid range |
Comparison with getOrdersHistory
| Feature | getOpenOrders | getOrdersHistory |
|---|---|---|
| Purpose | Currently open orders only | All orders with comprehensive history |
| Time Filtering | Not supported | fromTime/toTime range |
| Status Filtering | Single status filter | Multiple status filters |
| Default Scope | Active orders only | All orders (any status) |
| Use Case | Real-time order management | Historical analysis and reporting |
| Sorting | Creation order (newest first) | Configurable sort fields/order |