Skip to main content

command.trade_order.submit

Submit a trade order.

Method

command.trade_order.submit

Description

Submits a new trade order to an exchange. Supports market, limit, and stop orders with various time-in-force options.

Parameters

FieldTypeRequiredDescription
tradingAccountIdstringYesTrading account to use
instrumentIdstringYesInstrument to trade
orderSidestringYesOrder side (BUY, SELL)
orderTypestringYesOrder type
quantitystringYesOrder quantity
limitPricestringNo*Limit price (required for LIMIT orders)
stopPricestringNo*Stop price (required for STOP orders)
timeInForcestringNoTime in force (default: GTC)
orderQuantityTypestringNoQuantity type (BASE, QUOTE)
quantityRoundingstringNoRounding mode (DOWN, UP, NEAREST)

*Required depending on order type.

Order Types

TypeDescriptionRequired Fields
MARKETExecute at market pricequantity
LIMITExecute at limit price or betterquantity, limitPrice
STOP_MARKETMarket order triggered at stop pricequantity, stopPrice
STOP_LIMITLimit order triggered at stop pricequantity, limitPrice, stopPrice

Time In Force Options

OptionDescription
GTCGood till cancelled
IOCImmediate or cancel
FOKFill or kill

Result

Returns the submitted trade order object.

Trade Order Object

FieldTypeDescription
tradeOrderIdstringUnique order identifier
statusstringInitial status (PENDING)
......Other order fields

Usage

# Market buy order
result = await client.rpc("command.trade_order.submit", {
"tradingAccountId": "550e8400-e29b-41d4-a716-446655440000",
"instrumentId": "BINANCE:BTC/USDT",
"orderSide": "BUY",
"orderType": "MARKET",
"quantity": "0.1"
})

# Limit sell order
result = await client.rpc("command.trade_order.submit", {
"tradingAccountId": "550e8400-e29b-41d4-a716-446655440000",
"instrumentId": "BINANCE:BTC/USDT",
"orderSide": "SELL",
"orderType": "LIMIT",
"quantity": "0.1",
"limitPrice": "55000.00",
"timeInForce": "GTC"
})

Example Response

{
"tradeOrderId": "770e8400-e29b-41d4-a716-446655440002",
"tradingAccountId": "550e8400-e29b-41d4-a716-446655440000",
"venue": "BINANCE",
"instrumentId": "BINANCE:BTC/USDT",
"baseAsset": "BTC",
"quoteAsset": "USDT",
"orderSide": "BUY",
"orderType": "LIMIT",
"timeInForce": "GTC",
"status": "PENDING",
"limitPrice": "50000.00",
"quantity": "0.1",
"executedQuantity": "0",
"executedCost": "0",
"createdAt": 1703052635110,
"updatedAt": 1703052635110
}

Notes

  • Subscribe to the trading account channel for real-time order updates
  • Quantity precision must match instrument specifications
  • Use query.instrument.list to check supported order types