pub enum OrderType {
Show 17 variants
Market,
Limit {
price: f64,
},
StopMarket {
stop_price: f64,
},
StopLimit {
stop_price: f64,
limit_price: f64,
},
TrailingStop {
callback_rate: f64,
activation_price: Option<f64>,
},
Oco {
price: f64,
stop_price: f64,
stop_limit_price: Option<f64>,
},
Bracket {
price: Option<f64>,
take_profit: f64,
stop_loss: f64,
},
Iceberg {
price: f64,
display_quantity: f64,
},
Twap {
duration_seconds: u64,
interval_seconds: Option<u64>,
},
PostOnly {
price: f64,
},
Ioc {
price: Option<f64>,
},
Fok {
price: f64,
},
Gtd {
price: f64,
expire_time: i64,
},
ReduceOnly {
price: Option<f64>,
},
Oto {
entry_price: Option<f64>,
secondary_order: Box<OrderType>,
},
ConditionalPlan {
trigger_price: f64,
trigger_direction: TriggerDirection,
order_after_trigger: Box<OrderType>,
},
DcaRecurring {
interval_seconds: u64,
total_cycles: Option<u32>,
price_limit: Option<f64>,
},
}Expand description
Unified order type enum — covers all order variants across 24 exchanges.
A connector matches only the variants it supports natively.
For unsupported variants it returns ExchangeError::UnsupportedOperation.
Reading this enum IS reading the capability matrix for order types.
Variants§
Market
Plain market order — executes at best available price.
24/24 exchanges support this.
Limit
Limit order — executes at price or better.
24/24 exchanges support this.
StopMarket
Stop market — triggers a market order when stop_price is reached.
19/24: Binance, Bybit, OKX, KuCoin, Kraken, Coinbase, GateIO, Bitfinex, Bitstamp, MEXC, HTX, Bitget, BingX, Phemex, CryptoCom, Deribit, HyperLiquid, Paradex, dYdX.
StopLimit
Stop limit — triggers a limit order when stop_price is reached.
19/24: same exchanges as StopMarket minus some CEX spot-only.
Fields
TrailingStop
Trailing stop — follows best price by callback_rate percent.
10/24: Binance Futures, Bybit, OKX, KuCoin Futures, Bitget, BingX, Phemex, Deribit, HyperLiquid, Paradex.
Fields
Oco
OCO (One-Cancels-the-Other) — a limit order paired with a stop order. When one fills or triggers, the other is automatically cancelled.
7/24: Binance Spot, Gemini, Kraken, KuCoin Spot, GateIO, OKX, HTX.
Fields
Bracket
Bracket order — entry + attached TP + SL, all in one atomic request.
9/24: Bybit, OKX, Phemex, Bitget, BingX, Deribit, HyperLiquid, Paradex, dYdX.
Fields
Iceberg
Iceberg order — large order split into smaller visible chunks.
8/24: Binance, Bybit, OKX, KuCoin, GateIO, Bitfinex, Bitstamp, Deribit.
Fields
Twap
TWAP (Time-Weighted Average Price) — algorithmic order splitting execution over a time window.
7/24: Binance (algo), Bybit (algo), OKX (algo), KuCoin (algo), Bitget (algo), BingX (algo), HyperLiquid.
Fields
PostOnly
Post-Only limit — rejected if it would immediately match. Guarantees maker fee.
20/24: all except AMM-style DEXes (no maker/taker concept).
Ioc
Immediate-Or-Cancel — fills what it can immediately, cancels the rest.
21/24: all except AMM-based DEXes.
Fok
Fill-Or-Kill — must fill in full immediately or the entire order is cancelled.
17/24: Binance, Bybit, OKX, KuCoin, Kraken, GateIO, Bitfinex, Bitstamp, Gemini, MEXC, HTX, Bitget, Phemex, Deribit, HyperLiquid, Paradex, dYdX.
Gtd
Good-Till-Date — limit order that expires at expire_time.
8/24: Binance, Bybit, OKX, KuCoin, Kraken, Bitget, Deribit, Paradex.
Fields
ReduceOnly
Reduce-Only limit — only allowed to reduce an open position.
19/24: all futures-capable exchanges.
Returns UnsupportedOperation for spot-only exchanges.
Oto
OTO (One-Triggers-the-Other) — the secondary order is only placed if and when the primary (entry) order fills.
~8/24: Bybit, OKX, Binance, KuCoin, Phemex, HyperLiquid, Paradex, dYdX.
Fields
ConditionalPlan
Conditional plan — places an order of any type once a price trigger condition is met.
~12/24: Bybit, OKX, Binance Futures, KuCoin, GateIO, Bitget, BingX, Phemex, Deribit, HyperLiquid, Paradex, dYdX.
Fields
trigger_direction: TriggerDirectionDirection — does price need to go above or below trigger_price?
DcaRecurring
DCA (Dollar-Cost Averaging) recurring order — automatically repeats at a fixed interval for a number of cycles or indefinitely.
~5/24: Binance (algo), Bybit (algo), OKX (algo), Bitget (algo), BingX (algo).