PlaceOrder

Submit a new order to the exchange. Supports limit, market, stop-limit, stop-market, take-profit, stop-loss, and trailing stop orders.

POSTPlaceOrder🔐 Auth Required

Creates a new order on the specified market. The order is signed with your private key and submitted to the blockchain for deterministic execution.

Request

ParameterType
market_idrequireduint32
siderequiredOrderSide
typerequiredOrderType
priceoptionalint64
sizerequiredint64
time_in_forceoptionalTimeInForce
reduce_onlyoptionalbool
post_onlyoptionalbool
trigger_priceoptionalint64
trigger_directionoptionalTriggerDirection
trail_percentoptionalint64
expire_timeoptionaluint64
client_order_idoptionalstring

Response

FieldType
successbool
errorstring
order_iduint64
statusOrderStatus
filled_sizeint64
filled_priceint64
timestampuint64

Example

Requesttypescript
// Limit order
const order = await client.placeOrder({
market: 'RLM-PERP',
side: 'buy',
type: 'limit',
price: 100.00,
size: 1.0,
timeInForce: 'GTC',
});
// Market order
const marketOrder = await client.placeOrder({
market: 'RLM-PERP',
side: 'sell',
type: 'market',
size: 0.5,
});
// Stop-loss order
const 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

TypeValueDescription
LIMIT0Execute at specified price or better
MARKET1Execute immediately at best available price
STOP_LIMIT2Limit order that activates when trigger price is hit
STOP_MARKET3Market order that activates when trigger price is hit
TAKE_PROFIT4Close position at profit target
STOP_LOSS5Close position to limit losses
TRAILING_STOP6Dynamic stop that follows price movement

Time in Force

TIFValueDescription
GTC0Good-Till-Cancel: Remains open until filled or canceled
IOC1Immediate-Or-Cancel: Fill what you can, cancel rest
FOK2Fill-Or-Kill: Complete fill or nothing
GTD3Good-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

ErrorCause
INSUFFICIENT_BALANCENot enough margin/balance for the order
INVALID_PRICEPrice is zero, negative, or outside tick size
INVALID_SIZESize is below minimum or above maximum
POST_ONLY_WOULD_TAKEPost-only order would execute as taker
REDUCE_ONLY_WOULD_INCREASEReduce-only order would increase position