Skip to main content

Overview

The simulator.placeOrder endpoint places a simulated order in the exchange simulator. It supports both market and limit orders with configurable leverage and confidence levels.
This endpoint requires simulation mode to be enabled (IS_SIMULATION_ENABLED=true). Orders are executed against simulated market conditions and do not affect real funds.

Request

Parameters

string
The simulator account identifier. Defaults to "default" if not provided. Use different account IDs to simulate multiple portfolios.
string
required
Trading pair symbol (e.g., "BTC-USD", "ETH-USD"). Symbol is automatically trimmed of whitespace.
number
required
Order quantity in base currency. Must be a positive number.
enum<string>
required
Order side. Accepts: "buy", "sell", "long", or "short".
  • "buy" and "long" are equivalent (open/increase long position)
  • "sell" and "short" are equivalent (open/increase short position)
enum<string>
default:"market"
Order type. Accepts: "market" or "limit".
  • "market": Executes immediately at current market price
  • "limit": Executes only at specified limit price or better
number
Limit price for limit orders. Required when type is "limit". Must be a valid finite number.
number
Alternative parameter for limit price. If both limitPrice and price are provided, limitPrice takes precedence.
number
Position leverage multiplier. Must be a positive number. Allows trading with borrowed funds.Example: leverage: 5 means 5x leverage (controls 5000positionwith5000 position with 1000 margin).
number
AI model confidence level for the trade decision. Used for analytics and tracking.
  • Accepts values 0-1 (e.g., 0.85) or 0-100 (e.g., 85)
  • Values >1 are automatically normalized by dividing by 100
  • Invalid or zero values are stored as null

Response

object
The created order object containing execution details, position changes, and account state.

Code Example

Behavior Details

Order Execution

  • Market orders: Execute immediately at current simulator market price
  • Limit orders: Execute only when market price reaches the limit price
  • Order fills update the account’s positions, cash balance, and margin

Account ID Normalization

Account IDs are automatically normalized:
  • Empty strings or whitespace-only values default to "default"
  • Trimmed to remove leading/trailing whitespace
  • Use consistent account IDs to maintain separate portfolio states

Side Normalization

The side parameter accepts multiple formats:
  • "buy" or "long" → normalized to "buy" (increase long position)
  • "sell" or "short" → normalized to "sell" (increase short position)

Validation

  • Symbol cannot be empty after trimming
  • Quantity must be positive
  • Limit price (if provided) must be a finite number
  • Leverage (if provided) must be positive
  • Validation errors throw descriptive error messages

Error Handling

Common errors:
All orders are executed within the simulator’s isolated environment. Position and balance changes do not affect any live exchange accounts.