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

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

ParameterTypeDescription
market_idrequireduint32Market ID (0 = RLM-PERP, 1 = RLM-USDC, etc.)
siderequiredOrderSideBUY (0) or SELL (1)
typerequiredOrderTypeLIMIT (0), MARKET (1), STOP_LIMIT (2), STOP_MARKET (3), TAKE_PROFIT (4), STOP_LOSS (5), TRAILING_STOP (6)
priceoptionalint64Limit price (8 decimals). Required for LIMIT and STOP_LIMIT orders
sizerequiredint64Order size (8 decimals)
time_in_forceoptionalTimeInForceGTC (0), IOC (1), FOK (2), GTD (3)Default: GTC
reduce_onlyoptionalboolIf true, order can only reduce positionDefault: false
post_onlyoptionalboolIf true, order must be maker onlyDefault: false
trigger_priceoptionalint64Trigger price for conditional orders (8 decimals)
trigger_directionoptionalTriggerDirectionABOVE (0) or BELOW (1) - when to trigger
trail_percentoptionalint64Trail distance as percentage (8 decimals, e.g., 500000000 = 5%)
expire_timeoptionaluint64Expiration timestamp for GTD orders (nanoseconds)
client_order_idoptionalstringCustom order ID for client tracking

Response

FieldTypeDescription
successboolWhether the order was accepted
errorstringError message if success is false
order_iduint64Unique order identifier
statusOrderStatusOPEN, FILLED, PARTIALLY_FILLED, CANCELED
filled_sizeint64Amount filled immediately (8 decimals)
filled_priceint64Average fill price (8 decimals)
timestampuint64Server timestamp (nanoseconds)

Example

Request

// 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,
});

Response

{
"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