Simple Orders (Market, Limit, IOC, Iceberg)

Simple Orders provide a way to execute trades immediately with basic, exchange-level logic. Unlike algorithmic strategies (VWAP, TWAP or POV) which execute over a specified duration, simple orders are submitted for immediate or conditional execution.

These orders are submitted through the same POST /api/orders/ endpoint as algorithmic orders, but with a different strategy name and a simplified set of parameters.

General Parameters

The following parameters are used across all simple order types.

Required Fields:

  • strategy (string): Must be one of "Market", "Limit", "IOC", or "Iceberg".

  • pair (string): The trading pair symbol (e.g., "BTC-USD").

  • side (string): The order side, either "buy" or "sell".

  • accounts (array of strings): A list of account names to use for the order.

  • One of the following quantity fields is required:

    • base_asset_qty (decimal): The amount of the base asset to buy or sell.

    • quote_asset_qty (decimal): The amount of the quote asset to spend or receive.

    • sell_token_amount (decimal): The amount of the token you are selling.

Optional Fields:

  • notes (string): An arbitrary string for personal notes.

  • custom_order_id (string): A unique client-side ID for the order (max 64 chars).

  • pos_side (string): Use "long" or "short" for derivatives trading in hedge mode.

  • updated_leverage (integer): Update account leverage for the venue before placing the order.

  • market_type (string): The market type (e.g., "spot", "perp").

Parameters NOT Used by Simple Orders:

The following algorithmic parameters are ignored for simple orders and should not be sent:

  • duration

  • start_datetime

  • engine_passiveness

  • schedule_discretion

  • alpha_tilt

  • pov_target

  • pov_limit


Market Order

A market order is the most basic order type. It executes immediately at the best available price on the market. It prioritizes speed of execution over price.

Specific Parameters: None. A market order only requires the general parameters.

Example Request

POST /api/orders/
Authorization: Bearer <token>
Content-Type: application/json

{
  "pair": "BTC-USD",
  "side": "buy",
  "accounts": ["coinbase_main"],
  "strategy": "Market",
  "quote_asset_qty": "1000.00",
  "notes": "Simple market buy for $1000 of BTC"
}

Example Response

{
  "id": "a1b2c3d4-e5f6-7890-1234-567890abcdef",
  "custom_order_id": "",
  "notes": "Simple market buy for $1000 of BTC",
  "pair": "BTC-USD",
  "side": "buy",
  "exchanges": ["coinbase"],
  "buy_token": "BTC",
  "sell_token": "USD",
  "sell_token_amount": "1000.00",
  "strategy": "Market",
  "status": "ACTIVE",
  "user": "user_456",
  "created_at": "2024-01-10T14:30:00Z",
  "updated_at": "2024-01-10T14:30:01Z"
}

Limit Order

A limit order places an order at a specific price or better. A buy limit order will execute at the limit price or lower, and a sell limit order will execute at the limit price or higher. These orders are inherently passive and will only fill if the market reaches the specified price. By default, they are submitted as "post-only," meaning they will be rejected if they would execute immediately.

Specific Parameters:

  • limit_price (decimal, required): The specific price at which to execute the order.

Example Request

POST /api/orders/
Authorization: Bearer <token>
Content-Type: application/json

{
  "pair": "BTC-USD",
  "side": "buy",
  "accounts": ["coinbase_main"],
  "strategy": "Limit",
  "base_asset_qty": "0.5",
  "limit_price": "45000.00"
}

Example Response

{
  "id": "b2c3d4e5-f6a7-8901-2345-67890abcdef1",
  "custom_order_id": "",
  "notes": "",
  "pair": "BTC-USD",
  "side": "buy",
  "exchanges": ["coinbase"],
  "buy_token": "BTC",
  "buy_token_amount": "0.5",
  "sell_token": "USD",
  "strategy": "Limit",
  "limit_price": "45000.00",
  "status": "ACTIVE",
  "user": "user_456",
  "created_at": "2024-01-10T15:00:00Z",
  "updated_at": "2024-01-10T15:00:01Z"
}

Immediate-Or-Cancel (IOC) Order

An Immediate-Or-Cancel (IOC) order attempts to fill all or part of the order immediately. Any portion of the order that cannot be filled instantly is canceled. This is useful when you want to capture the current price but do not want the order to remain open if it's not filled.

Specific Parameters: None. The IOC behavior is entirely defined by the strategy itself.

Example Request

POST /api/orders/
Authorization: Bearer <token>
Content-Type: application/json

{
  "pair": "ETH-USD",
  "side": "sell",
  "accounts": ["binance_main"],
  "strategy": "IOC",
  "base_asset_qty": "10.0"
}

Example Response

{
  "id": "c3d4e5f6-a7b8-9012-3456-7890abcdef12",
  "custom_order_id": "",
  "notes": "",
  "pair": "ETH-USD",
  "side": "sell",
  "exchanges": ["binance"],
  "buy_token": "USD",
  "sell_token": "ETH",
  "sell_token_amount": "10.0",
  "strategy": "IOC",
  "status": "ACTIVE",
  "user": "user_456",
  "created_at": "2024-01-10T16:00:00Z",
  "updated_at": "2024-01-10T16:00:01Z"
}

Iceberg Order

An Iceberg order is used to place a large order without revealing the full order size to the market. The order is broken down into smaller "slices" or child orders, with only one slice visible on the order book at a time. Once a slice is filled, the next one is placed until the entire order is complete.

Specific Parameters:

  • order_slices (integer, recommended): The number of visible child orders (slices) to break the total quantity into. Defaults to 10 if not provided.

  • limit_price (decimal, optional): You can optionally provide a limit price for the iceberg order.

Example Request

POST /api/orders/
Authorization: Bearer <token>
Content-Type: application/json

{
  "pair": "SOL-USD",
  "side": "buy",
  "accounts": ["coinbase_pro"],
  "strategy": "Iceberg",
  "base_asset_qty": "1000.0",
  "order_slices": 20,
  "limit_price": "140.00"
}

Example Response

{
  "id": "d4e5f6a7-b8c9-0123-4567-890abcdef123",
  "custom_order_id": "",
  "notes": "",
  "pair": "SOL-USD",
  "side": "buy",
  "exchanges": ["coinbase_pro"],
  "buy_token": "SOL",
  "buy_token_amount": "1000.0",
  "sell_token": "USD",
  "strategy": "Iceberg",
  "order_slices": 20,
  "limit_price": "140.00",
  "status": "ACTIVE",
  "user": "user_456",
  "created_at": "2024-01-10T17:00:00Z",
  "updated_at": "2024-01-10T17:00:02Z"
}

Last updated

Was this helpful?