Skip to main content

Create Order via WebSocket

To create orders on Rails platform, use the WebSocket API and subscribe to the Order Creation Stream. The specifications and behavior remain the same.

Order Creation Workflow

Order creation is done by submitting a Create Order request. You will receive two responses in sequence:
  • Acknowledgment: Confirms the request was received and validates basic parameters
  • Confirmation: Confirms the order was accepted and created in the order book
Key differences:
AcknowledgmentConfirmation
Bodyorder created, pending acceptanceorder accepted
Order Statuspendingactive
Status Code202200
API Quota UsedIncludedNot included
Note that a unique clientRequestId can be used to correlate acknowledgment, confirmation, and any error responses for a single request.

Order Types

Limit Orders

Limit orders allow you to specify an exact price at which you want to trade. They provide price certainty but execution is not guaranteed. Key Characteristics:
  • Order executes only at the specified price or better
  • May remain open in the order book until filled or cancelled
  • Can use post-only option to ensure maker status
Post-Only Option: When set to true, the order will only be created if it does not match with an existing order in the order book. This ensures you are always the maker and never the taker. If the order would match immediately, you’ll receive normal acknowledgment and confirmation responses, but followed by Order Rejected Notifications.

Market Orders

Market orders prioritize execution speed over price certainty. They execute immediately against the best available prices in the order book. Key Characteristics:
  • Execute immediately at the best available market prices
  • Use maxSlippage parameter to control price deviation (defaults to 0.02)
  • Any unfilled quantity is automatically cancelled after execution
Slippage Protection:
  • Buy orders: Fill price never exceeds expectedPrice × (1 + maxSlippage)
  • Sell orders: Fill price never goes below expectedPrice × (1 - maxSlippage)
Request Field Differences from Limit Orders:
FieldLimit Order ValueMarket Order Value
tradeTypelimitmarket
postOnlytrue or falseNot supported
maxSlippageNot supported0 - 1 inclusive
priceStrict priceExpected price

IOC (Immediate-Or-Cancel) Orders

IOC orders can be achieved by creating a market order with maxSlippage of 0. They execute as much as possible immediately and cancel any unfilled portion.

Order Limits and Restrictions

Maximum Open Orders Per Market

See Rate Limits page for details.

Price and Quantity Restrictions

  • Price bounds: Orders must be within 50% of current index price
  • Market-specific limits: Each market has tick size, lot size, and minimum order value requirements. See Product Specifications for details.

Receive Window

All order creation requests must be processed within a 2-second receive window. Requests exceeding this timeframe are rejected with error message receive window exceeded, order rejected. Key points:
  • Only applies to order creation and modification, not cancellation
  • Frequent rejections may indicate that you are submitting requests too quickly
  • Reduce submission rate when encountering this error

Margin Mode and Leverage

Both margin mode and leverage are applied at the market level rather than per-trade. All positions within the same market share the same margin mode and leverage, and each market can be configured independently.

Margin Mode

  • Supported values: C (cross margin) and I (isolated margin)
  • Default margin mode is C (cross) if not explicitly set
  • Update margin mode using the Update Margin Mode REST endpoint
  • See Risk Management for how each mode affects liquidation and collateral

Leverage

  • Supported values: 1, 2, 3, 4, 5
  • Default leverage is 1 if not explicitly set
  • Update leverage using the Update Leverage REST endpoint