Skip to content

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/trade

Request

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

ParameterTypeRequiredDescription
paramsobjectYesRequest parameters wrapper
params.actionstringYesMust be "getOpenOrders"
params.subAccountIdstringYesSubAccount ID to retrieve orders for
params.symbolstringNoFilter orders by specific market symbol (e.g., "BTC-USDT")
params.sidestringNoFilter by order side: "buy" or "sell"
params.typestringNoFilter by order type (e.g., "LIMIT", "MARKET")
params.statusstringNoFilter by order status (e.g., "NEW", "PARTIALLY_FILLED")
params.limitintegerNoMaximum number of orders to return (default: 50)
params.offsetintegerNoNumber of orders to skip for pagination (default: 0)
ParameterTypeRequiredDescription
nonceuint64YesUnix milliseconds timestamp (must be monotonically increasing)
signatureobjectYesEIP-712 signature object
expiresAfteruint64NoUnix milliseconds expiration timestamp (5x rate limit on stale cancels)

Response

Response Structure

FieldTypeDescription
statusstringAlways "ok" for successful requests or "error" for failures
responsearrayArray of open order objects matching filter criteria (omitted when status is "error")
errorobjectError details (only present when status is "error")
request_idstringRequest tracking identifier
timestampstringRFC3339 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

FieldTypeDescription
orderIdstringUnique order identifier (uint64 as string)
symbolstringTrading pair symbol (e.g., "BTC-USDT")
sidestringOrder side: "buy" or "sell"
typestringOrder type (e.g., "LIMIT", "MARKET")
quantitystringTotal order quantity
pricestringOrder price (empty for market orders)
triggerPricestringTrigger price for conditional orders
triggerPriceTypestringTrigger price type: "mark", "last", or "index"
timeInForcestringTime in force: "GTC", "IOC", or "FOK"
reduceOnlybooleanWhether order can only reduce position
postOnlybooleanWhether order must be maker (no immediate match)
closePositionbooleanWhether order closes entire position
createdTimeintegerOrder creation timestamp (Unix seconds)
updatedTimeintegerLast update timestamp (Unix seconds)
filledQuantitystringQuantity that has been filled
takeProfitOrderIdstringID of linked take-profit order (present on entry orders when using TP/SL grouping, empty string otherwise)
stopLossOrderIdstringID 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: takeProfitOrderId and stopLossOrderId contain 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:

ErrorDescription
Invalid signatureEIP-712 signature validation failed
Invalid market symbolMarket symbol not recognized
Nonce already usedNonce must be greater than previous value
Rate limit exceededToo many requests in time window
Request expiredexpiresAfter timestamp has passed
ErrorDescription
Invalid request formatRequest payload could not be parsed
Internal errorFailed to retrieve orders
Subaccount not foundSpecified subaccount does not exist
Invalid symbolSpecified symbol is not recognized
Invalid paginationLimit or offset out of valid range

Comparison with getOrdersHistory

FeaturegetOpenOrdersgetOrdersHistory
PurposeCurrently open orders onlyAll orders with comprehensive history
Time FilteringNot supportedfromTime/toTime range
Status FilteringSingle status filterMultiple status filters
Default ScopeActive orders onlyAll orders (any status)
Use CaseReal-time order managementHistorical analysis and reporting
SortingCreation order (newest first)Configurable sort fields/order