#[non_exhaustive]pub struct AlgoOrderUpdate {Show 52 fields
pub inst_type: String,
pub inst_id: String,
pub ccy: String,
pub ord_id: String,
pub ord_id_list: Vec<String>,
pub cl_ord_id: String,
pub algo_id: String,
pub algo_cl_ord_id: String,
pub sz: NumberString,
pub ord_type: String,
pub side: String,
pub pos_side: String,
pub td_mode: String,
pub tgt_ccy: String,
pub state: String,
pub lever: NumberString,
pub notional_usd: NumberString,
pub last: NumberString,
pub actual_sz: NumberString,
pub actual_px: NumberString,
pub actual_side: String,
pub trigger_px: NumberString,
pub trigger_px_type: String,
pub trigger_time: NumberString,
pub tp_trigger_px: NumberString,
pub tp_trigger_px_type: String,
pub tp_ord_px: NumberString,
pub sl_trigger_px: NumberString,
pub sl_trigger_px_type: String,
pub sl_ord_px: NumberString,
pub ord_px: NumberString,
pub callback_ratio: NumberString,
pub callback_spread: NumberString,
pub active_px: NumberString,
pub move_trigger_px: NumberString,
pub reduce_only: String,
pub tag: String,
pub fail_code: String,
pub fail_reason: String,
pub amend_px_on_trigger_type: String,
pub amend_result: String,
pub close_fraction: String,
pub quick_mgn_type: String,
pub req_id: String,
pub trade_quote_ccy: String,
pub linked_ord: Option<LinkedOrder>,
pub is_trade_borrow_mode: Value,
pub attach_algo_ords: Vec<Value>,
pub c_time: NumberString,
pub u_time: NumberString,
pub p_time: NumberString,
pub extra: ExtraFields,
}Expand description
Private orders-algo channel row.
OKX docs: https://www.okx.com/docs-v5/en/#order-book-trading-algo-trading-ws-algo-orders-channel
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.inst_type: StringInstrument type, e.g., SPOT, MARGIN, SWAP, FUTURES, OPTION.
inst_id: StringInstrument ID, e.g., BTC-USDT.
ccy: StringMargin currency (cross-margin orders only).
ord_id: StringOKX-assigned regular order ID (populated when the algo fires and places an order).
ord_id_list: Vec<String>List of regular order IDs associated with this algo order.
cl_ord_id: StringClient-supplied order ID, if any.
algo_id: StringOKX-assigned algo order ID.
algo_cl_ord_id: StringClient-supplied algo order ID.
sz: NumberStringOrder size.
ord_type: StringAlgo order type.
Documented values: conditional, oco, trigger, move_order_stop,
chase_order, iceberg, twap.
side: StringOrder side: buy or sell.
pos_side: StringPosition side: long, short, or net.
td_mode: StringTrade mode: cross, isolated, or cash.
tgt_ccy: StringTarget currency for quantity (spot currency-trade only): base_ccy or quote_ccy.
state: StringAlgo order state.
Documented values: live, pause, partially_effective, effective,
canceled, order_failed, partially_failed.
lever: NumberStringLeverage.
notional_usd: NumberStringEstimated notional value in USD.
last: NumberStringLast traded price at the time of the push.
actual_sz: NumberStringActual order size when the algo fires.
actual_px: NumberStringActual order price when the algo fires.
actual_side: StringEffective side of the actual order when the algo fires.
trigger_px: NumberStringTrigger price (for trigger and move_order_stop types).
trigger_px_type: StringTrigger price type: last, index, or mark.
trigger_time: NumberStringTrigger time (Unix milliseconds).
tp_trigger_px: NumberStringTake-profit trigger price.
tp_trigger_px_type: StringTake-profit trigger price type: last, index, or mark.
tp_ord_px: NumberStringTake-profit order price; -1 means market order.
sl_trigger_px: NumberStringStop-loss trigger price.
sl_trigger_px_type: StringStop-loss trigger price type: last, index, or mark.
sl_ord_px: NumberStringStop-loss order price; -1 means market order.
ord_px: NumberStringOrder price used when the algo fires.
callback_ratio: NumberStringTrailing callback ratio (for move_order_stop and chase_order types).
callback_spread: NumberStringTrailing callback spread (for move_order_stop and chase_order types).
active_px: NumberStringActivated tracking price (for move_order_stop and chase_order types).
move_trigger_px: NumberStringPrice that activated the trailing move trigger.
reduce_only: StringWhether this is a reduce-only order: "true" or "false".
tag: StringOrder tag.
fail_code: StringError code when state is order_failed; empty otherwise.
fail_reason: StringHuman-readable reason for failure.
amend_px_on_trigger_type: StringAmend-price-on-trigger type.
Documented values: 0 (no amend), 1 (amend to market price at trigger).
amend_result: StringResult of the last amend request.
close_fraction: StringFraction of the position to close.
quick_mgn_type: StringQuick margin type.
req_id: StringClient-supplied request ID for the latest amend.
trade_quote_ccy: StringThe quote currency used for trading.
linked_ord: Option<LinkedOrder>Linked regular order; present when the algo has fired and placed an order.
is_trade_borrow_mode: ValueWhether the order uses borrow mode.
OKX sends "" for non-applicable order types and a JSON boolean (true/false)
for applicable ones, so this field uses Value to handle both.
attach_algo_ords: Vec<Value>Attached TP/SL algo orders.
c_time: NumberStringAlgo order creation time (Unix milliseconds).
u_time: NumberStringLast update time (Unix milliseconds).
p_time: NumberStringPush time (Unix milliseconds).
extra: ExtraFieldsUnrecognized fields retained for forward compatibility.
Trait Implementations§
Source§impl Clone for AlgoOrderUpdate
impl Clone for AlgoOrderUpdate
Source§fn clone(&self) -> AlgoOrderUpdate
fn clone(&self) -> AlgoOrderUpdate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more