For the complete documentation index, see llms.txt. This page is also available as Markdown.

Order Entry

Order entry operations

Create order

post
/createOrder

Create a new order (IOC, GTC, SL, TP)

Body
exchangeIdintegerRequiredExample: 1747927089946
symbolstringOptional

Trading symbol (e.g., BTCRUSDPERP, WETHRUSD)

Example: BTCRUSDPERPPattern: ^[A-Za-z0-9]+$
accountIdintegerRequiredExample: 1747927089946
isBuybooleanRequired

Whether this is a buy order

Example: true
limitPxstringRequiredExample: 43000.00Pattern: ^-?\d+(\.\d+)?([eE][+-]?\d+)?$
qtystringOptionalExample: 1.0Pattern: ^\d+(\.\d+)?([eE][+-]?\d+)?$
orderTypestring · enumRequired

Order type, (LIMIT = Limit, TP = Take Profit, SL = Stop Loss)

Example: LIMITPossible values:
timeInForcestring · enumOptional

Order time in force, exclusively used for LIMIT orders

Example: GTCPossible values:
triggerPxstringOptional

Trigger price, only for TP/SL orders

Example: 43000.00Pattern: ^-?\d+(\.\d+)?([eE][+-]?\d+)?$
reduceOnlybooleanOptional

Whether this is a reduce-only order, exclusively used for LIMIT IOC orders.

Example: false
signaturestringRequired

See signatures and nonces section for more details on how to generate.

Example: 0x1234...
noncestringRequired

Order nonce, see signatures and nonces section for more details.

Example: 1234567890
signerWalletstringRequiredExample: 0x6c51275fd01d5dbd2da194e92f920f8598306df2Pattern: ^0x[a-fA-F0-9]{40}$
expiresAfterintegerOptional

Expiration timestamp (exclusively for PERP IOC orders and all SPOT orders). In seconds since epoch. The order will only be filled before this timestamp.

Example: 1747927089946
clientOrderIdintegerOptional

Client-provided order ID for tracking and correlation. Optional field that allows clients to assign their own unique identifier to orders.

Example: 1747927089946
Other propertiesanyOptional
Responses
200

Order creation response

application/json
statusstring · enumRequired

Order status

Possible values:
execQtystringOptional

Executed quantity in the current order update.

Example: 1.0Pattern: ^\d+(\.\d+)?([eE][+-]?\d+)?$
cumQtystringOptional

Total Executed quantity accross all fills where the order is involved.

Example: 1.0Pattern: ^\d+(\.\d+)?([eE][+-]?\d+)?$
orderIdstringOptional

Created order ID (currently generated for all order types except IOC)

Example: 123456789-123123123
clientOrderIdintegerOptional

Client-provided order ID echoed back from the request

Example: 1747927089946
firstFillIdstringOptional

Matching-engine fill nonce of the first fill this order produced on entry. Together with fillCount it identifies the fills as a contiguous nonce range [firstFillId, firstFillId + fillCount - 1]. Absent if the order did not fill on entry. For a non-IOC (resting) taker, the same first nonce also appears on the order's taker update in the orderChanges channel; an IOC taker is not published to orderChanges, so this response is the only place its fill range is delivered.

Example: 7205759403792794624
fillCountintegerOptional

Number of fills this order produced on entry — the length of the contiguous nonce range starting at firstFillId. Absent if the order did not fill on entry (so it is >= 1 whenever present).

Example: 1747927089946
Other propertiesanyOptional
post/createOrder
POST /v2/createOrder HTTP/1.1
Host: api.reya.xyz
Content-Type: application/json
Accept: */*
Content-Length: 406

{
  "exchangeId": 1747927089946,
  "symbol": "BTCRUSDPERP",
  "accountId": 1747927089946,
  "isBuy": true,
  "limitPx": "43000.00",
  "qty": "1.0",
  "orderType": "LIMIT",
  "timeInForce": "GTC",
  "triggerPx": "43000.00",
  "reduceOnly": false,
  "signature": "0x1234...",
  "nonce": "1234567890",
  "signerWallet": "0x6c51275fd01d5dbd2da194e92f920f8598306df2",
  "expiresAfter": 1747927089946,
  "clientOrderId": 1747927089946,
  "ANY_ADDITIONAL_PROPERTY": "anything"
}
{
  "status": "OPEN",
  "execQty": "1.0",
  "cumQty": "1.0",
  "orderId": "123456789-123123123",
  "clientOrderId": 1747927089946,
  "firstFillId": "7205759403792794624",
  "fillCount": 1747927089946,
  "ANY_ADDITIONAL_PROPERTY": "anything"
}

Cancel order

post
/cancelOrder

Cancel an existing order

Body
orderIdstringOptional

Internal matching engine order ID to cancel. At least one of orderId or clientOrderId must be provided; if both are supplied the server treats orderId as the canonical identifier and clientOrderId is ignored. For spot markets, this is the order ID returned in the CreateOrderResponse.

Example: 490346525705109504
clientOrderIdintegerOptional

Client-provided order ID for tracking and correlation. At least one of orderId or clientOrderId must be provided; clientOrderId is consulted only when orderId is absent. This is the same clientOrderId provided in CreateOrderRequest.

Example: 1747927089946
accountIdintegerOptional

Account ID that owns the order. Required for spot markets.

Example: 1747927089946
symbolstringOptional

Market symbol for the order.Required for spot market orders. If not provided, assumes perp market for backwards compatibility.

Example: BTCRUSDPERPPattern: ^[A-Za-z0-9]+$
signaturestringRequired

See signatures section for more details on how to generate.

Example: 0x5678...
noncestringOptional

See signatures and nonces section for more details. Compulsory for spot orders.

Example: 1234567890
expiresAfterintegerOptional

Expiration timestamp (exclusively for SPOT orders). In seconds since epoch.

Example: 1747927089946
Other propertiesanyOptional
Responses
200

Order cancellation response

application/json
statusstring · enumRequired

Order status

Possible values:
orderIdstringRequired

Cancelled order ID

Example: 123456789-123123123
clientOrderIdintegerOptional

Client-provided order ID echoed back from the request

Example: 123456789
Other propertiesanyOptional
post/cancelOrder
POST /v2/cancelOrder HTTP/1.1
Host: api.reya.xyz
Content-Type: application/json
Accept: */*
Content-Length: 222

{
  "orderId": "490346525705109504",
  "clientOrderId": 1747927089946,
  "accountId": 1747927089946,
  "symbol": "BTCRUSDPERP",
  "signature": "0x5678...",
  "nonce": "1234567890",
  "expiresAfter": 1747927089946,
  "ANY_ADDITIONAL_PROPERTY": "anything"
}
{
  "status": "OPEN",
  "orderId": "123456789-123123123",
  "clientOrderId": "123456789",
  "ANY_ADDITIONAL_PROPERTY": "anything"
}

Cancel all orders

post
/cancelAll

Cancel all orders matching the specified filters (mass cancel)

Body

Request to cancel all orders matching the specified filters

accountIdintegerRequired

Account ID to cancel orders for.

Example: 1747927089946
symbolstringOptional

Symbol to cancel orders for. If not specified, cancels orders for all symbols.

Example: BTCRUSDPERPPattern: ^[A-Za-z0-9]+$
signaturestringRequired

See signatures and nonces section for more details on how to generate.

Example: 0x1234...
noncestringRequired

See signatures and nonces section for more details.

Example: 1234567890
expiresAfterintegerRequired

Expiration timestamp. In seconds since epoch.

Example: 1747927089946
Other propertiesanyOptional
Responses
200

Mass cancel response

application/json
cancelledCountintegerRequired

Number of orders that were cancelled

Example: 1747927089946
Other propertiesanyOptional
post/cancelAll
POST /v2/cancelAll HTTP/1.1
Host: api.reya.xyz
Content-Type: application/json
Accept: */*
Content-Length: 161

{
  "accountId": 1747927089946,
  "symbol": "BTCRUSDPERP",
  "signature": "0x1234...",
  "nonce": "1234567890",
  "expiresAfter": 1747927089946,
  "ANY_ADDITIONAL_PROPERTY": "anything"
}
{
  "cancelledCount": 1747927089946,
  "ANY_ADDITIONAL_PROPERTY": "anything"
}

Last updated