PlaceOrder
Submit a new order to the exchange. Supports limit, market, stop-limit, stop-market, take-profit, stop-loss, and trailing stop orders.
POST
PlaceOrder🔐 Auth RequiredCreates a new order on the specified market. The order is signed with your private key and submitted to the blockchain for deterministic execution.
Request
| Parameter | Type |
|---|---|
market_idrequired | uint32 |
siderequired | OrderSide |
typerequired | OrderType |
priceoptional | int64 |
sizerequired | int64 |
time_in_forceoptional | TimeInForce |
reduce_onlyoptional | bool |
post_onlyoptional | bool |
trigger_priceoptional | int64 |
trigger_directionoptional | TriggerDirection |
trail_percentoptional | int64 |
expire_timeoptional | uint64 |
client_order_idoptional | string |
Response
| Field | Type |
|---|---|
success | bool |
error | string |
order_id | uint64 |
status | OrderStatus |
filled_size | int64 |
filled_price | int64 |
timestamp | uint64 |
Example
Requesttypescript
// Limit orderconst order = await client.placeOrder({market: 'RLM-PERP',side: 'buy',type: 'limit',price: 100.00,size: 1.0,timeInForce: 'GTC',});// Market orderconst marketOrder = await client.placeOrder({market: 'RLM-PERP',side: 'sell',type: 'market',size: 0.5,});// Stop-loss orderconst stopLoss = await client.placeOrder({market: 'RLM-PERP',side: 'sell',type: 'stop_market',size: 1.0,triggerPrice: 90.00,triggerDirection: 'below',reduceOnly: true,});// Trailing stop (5% trail)const trailingStop = await client.placeOrder({market: 'RLM-PERP',side: 'sell',type: 'trailing_stop',size: 1.0,trailPercent: 5.0,reduceOnly: true,});
Responsejson
{"success": true,"orderId": "12345678","status": "OPEN","filledSize": 0,"filledPrice": 0,"timestamp": 1704067200000000000}
Order Types
| Type | Value | Description |
|---|---|---|
LIMIT | 0 | Execute at specified price or better |
MARKET | 1 | Execute immediately at best available price |
STOP_LIMIT | 2 | Limit order that activates when trigger price is hit |
STOP_MARKET | 3 | Market order that activates when trigger price is hit |
TAKE_PROFIT | 4 | Close position at profit target |
STOP_LOSS | 5 | Close position to limit losses |
TRAILING_STOP | 6 | Dynamic stop that follows price movement |
Time in Force
| TIF | Value | Description |
|---|---|---|
GTC | 0 | Good-Till-Cancel: Remains open until filled or canceled |
IOC | 1 | Immediate-Or-Cancel: Fill what you can, cancel rest |
FOK | 2 | Fill-Or-Kill: Complete fill or nothing |
GTD | 3 | Good-Till-Date: Expires at specified time |
Decimal Precision
All prices and sizes use 8 decimal places internally. The SDK handles conversion automatically, but when using the raw API, multiply by 10^8. For example, price 100.50 becomes 10050000000.
Conditional Orders
Stop and trailing stop orders are held by the trigger engine until their conditions are met. They don't appear in GetOpenOrders until triggered — use GetConditionalOrders instead.
Common Errors
| Error | Cause |
|---|---|
INSUFFICIENT_BALANCE | Not enough margin/balance for the order |
INVALID_PRICE | Price is zero, negative, or outside tick size |
INVALID_SIZE | Size is below minimum or above maximum |
POST_ONLY_WOULD_TAKE | Post-only order would execute as taker |
REDUCE_ONLY_WOULD_INCREASE | Reduce-only order would increase position |