Skip to main content
Function:
ABI Object:
Parameters:
  • signer - The account signer
  • subaccount - The Trading Account object
  • market - The PerpMarket object
  • price - Order price `<u64>`
  • size - Order size `<u64>`
  • is_buy - True for buy order, false for sell order
  • time_in_force - Time in force `<u8>`: 0 = GoodTillCanceled, 1 = PostOnly, 2 = ImmediateOrCancel
  • is_reduce_only - Whether order can only reduce position size
  • client_order_id - Optional client-assigned order ID `<Option<String>>`
  • stop_price - Optional stop price `<Option<u64>>`
  • tp_trigger_price - Optional take-profit trigger price `<Option<u64>>`
  • tp_limit_price - Optional take-profit limit price `<Option<u64>>`
  • sl_trigger_price - Optional stop-loss trigger price `<Option<u64>>`
  • sl_limit_price - Optional stop-loss limit price `<Option<u64>>`
  • builder_address - Optional builder/referrer address `<Option<address>>`
  • builder_fees - Optional builder fee in basis points `<Option<u64>>`

Time in Force Options

When placing orders, you can specify different execution types using the time_in_force parameter:
  • 0 (GoodTillCanceled) - Order stays active until it is filled or manually canceled
  • 1 (PostOnly) - Order only adds liquidity to the order book (becomes a maker order). If the order would execute immediately, it is canceled
  • 2 (ImmediateOrCancel) - Order executes immediately at the best available price. Any unfilled portion is canceled
Example: