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
},
"expiresAfter": 1704067500,
"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* | Positive integer nonce (must be incrementing and unique per request) |
signature | object | Yes | EIP-712 signature object |
expiresAfter | uint64 | No | Unix milliseconds expiration timestamp (5x rate limit on stale cancels) |
:::info Common Parameters
These are top-level request parameters. The subAccountId parameter is specified within the params object (see each endpoint's parameter table).
:::
:::info SubAccountAction Endpoints
Endpoints using SubAccountAction signing (getPositions, getOpenOrders, getOrdersHistory, getTrades, getFundingPayments, getSubAccount, getSubAccounts, getDelegatedSigners, getBalanceUpdates) do not require the nonce parameter. Only signature and optional expiresAfter are needed.
:::
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 |
Success Response
{
"status": "ok",
"response": [
{
"order": {
"venueId": "1958787130134106112",
"clientId": "cli-1958787130134106112"
},
"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": 1755846234000,
"updatedTime": 1755846234000,
"filledQuantity": "0.0",
"takeProfitOrder": {
"venueId": "1958787130134106115",
"clientId": "cli-1958787130134106115"
},
"takeProfitOrderId": "1958787130134106115",
"stopLossOrder": {
"venueId": "1958787130134106116",
"clientId": "cli-1958787130134106116"
},
"stopLossOrderId": "1958787130134106116"
},
{
"order": {
"venueId": "1958787130134106113",
"clientId": "cli-1958787130134106113"
},
"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": 1755846235000,
"updatedTime": 1755846235000,
"filledQuantity": "0.5",
"takeProfitOrderId": "",
"stopLossOrderId": ""
}
],
"request_id": "5ccf215d37e3ae6d"
}Empty Result
{
"status": "ok",
"response": [],
"request_id": "5ccf215d37e3ae6f"
}Order Object Fields
| Field | Type | Description |
|---|---|---|
order | object | Canonical order identifier object |
order.venueId | string | Canonical venue-generated order identifier |
order.clientId | string | Optional client-provided order identifier |
orderId | string | Deprecated legacy order identifier (venue ID 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 milliseconds) |
updatedTime | integer | Last update timestamp (Unix milliseconds) |
filledQuantity | string | Quantity that has been filled |
takeProfitOrder | object | Canonical linked take-profit order identifier object |
takeProfitOrderId | string | Deprecated linked take-profit venue ID |
stopLossOrder | object | Canonical linked stop-loss order identifier object |
stopLossOrderId | string | Deprecated linked stop-loss venue ID |
Migration Note: Use order.venueId as the canonical order ID. Legacy orderId, takeProfitOrderId, and stopLossOrderId fields are deprecated compatibility fields.
Note on TP/SL Fields: When orders are placed with normalTpsl or positionTpsl grouping, the entry order will contain takeProfitOrder / stopLossOrder linking to the associated TP/SL trigger orders. Deprecated takeProfitOrderId / stopLossOrderId are still returned for compatibility.
Error Response
{
"status": "error",
"error": {
"code": "INVALID_FORMAT",
"message": "Invalid request body"
},
"request_id": "5ccf215d37e3ae6d"
}Usage Examples
Get All Open Orders
{
"params": {
"action": "getOpenOrders",
"subAccountId": "1867542890123456789"
},
"expiresAfter": 1704067500,
"signature": { "v": 28, "r": "0x...", "s": "0x..." }
}Get Open Orders for Specific Market
{
"params": {
"action": "getOpenOrders",
"subAccountId": "1867542890123456789",
"symbol": "BTC-USDT"
},
"expiresAfter": 1704067500,
"signature": { "v": 28, "r": "0x...", "s": "0x..." }
}Get Open Buy Orders with Pagination
{
"params": {
"action": "getOpenOrders",
"subAccountId": "1867542890123456789",
"side": "buy",
"limit": 100,
"offset": 0
},
"expiresAfter": 1704067500,
"signature": { "v": 28, "r": "0x...", "s": "0x..." }
}EIP-712 Signature
const domain = {
name: "Synthetix",
version: "1",
chainId: 1,
verifyingContract: "0x0000000000000000000000000000000000000000"
};
const types = {
SubAccountAction: [
{ name: "subAccountId", type: "uint256" },
{ name: "action", type: "string" },
{ name: "expiresAfter", type: "uint256" }
]
};
const message = {
subAccountId: "1867542890123456789",
action: "getOpenOrders",
expiresAfter: 0
};
const signature = await signer._signTypedData(domain, types, message);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: use
takeProfitOrder.venueIdandstopLossOrder.venueIdas canonical IDs (takeProfitOrderId/stopLossOrderIdremain deprecated compatibility fields)
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 any positive integer as nonce
- Each nonce must be greater than the previous one (incrementing)
Date.now()is a convenient option, not a requirement- If nonce conflicts occur, increment by 1 and retry
:::note SubAccountAction Exception
SubAccountAction endpoints (getPositions, getOpenOrders, getOrdersHistory, getTrades, getFundingPayments, getSubAccount, getSubAccounts, getDelegatedSigners, getBalanceUpdates) do not require a nonce. Only the signature and optional expiresAfter parameters are needed.
:::
Error Handling
Common error scenarios:
| Error Code | Description | Retryable |
|---|---|---|
UNAUTHORIZED | EIP-712 signature validation failed | No |
VALIDATION_ERROR | Request validation failed | No |
MISSING_REQUIRED_FIELD | Required field is missing | No |
INVALID_FORMAT | Field format is invalid | No |
INVALID_VALUE | Invalid parameter value | No |
RATE_LIMIT_EXCEEDED | Too many requests in time window | Yes |
INSUFFICIENT_MARGIN | Not enough margin for trade | No |
ORDER_NOT_FOUND | Order does not exist | No |
OPERATION_TIMEOUT | Operation timed out | Yes |
| 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 |