#[non_exhaustive]pub struct OrderUpdate {Show 69 fields
pub inst_type: String,
pub inst_id: String,
pub tgt_ccy: String,
pub ccy: String,
pub ord_id: String,
pub cl_ord_id: String,
pub tag: String,
pub px: NumberString,
pub sz: NumberString,
pub notional_usd: NumberString,
pub ord_type: String,
pub side: String,
pub pos_side: String,
pub td_mode: String,
pub acc_fill_sz: NumberString,
pub fill_px: NumberString,
pub trade_id: String,
pub fill_sz: NumberString,
pub fill_time: NumberString,
pub fill_pnl: NumberString,
pub fill_fee: NumberString,
pub fill_fee_ccy: String,
pub fill_notional_usd: NumberString,
pub fill_px_vol: NumberString,
pub fill_px_usd: NumberString,
pub fill_mark_vol: NumberString,
pub fill_fwd_px: NumberString,
pub fill_mark_px: NumberString,
pub fill_idx_px: NumberString,
pub exec_type: String,
pub avg_px: NumberString,
pub state: String,
pub lever: NumberString,
pub attach_algo_cl_ord_id: String,
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 fee_ccy: String,
pub fee: NumberString,
pub rebate_ccy: String,
pub rebate: NumberString,
pub pnl: NumberString,
pub source: String,
pub category: String,
pub reduce_only: String,
pub is_tp_limit: String,
pub cancel_source: String,
pub algo_cl_ord_id: String,
pub algo_id: String,
pub amend_source: String,
pub amend_result: String,
pub req_id: String,
pub code: String,
pub msg: String,
pub px_type: String,
pub px_usd: NumberString,
pub px_vol: NumberString,
pub linked_algo_ord: Value,
pub attach_algo_ords: Vec<Value>,
pub stp_mode: String,
pub trade_quote_ccy: String,
pub last_px: NumberString,
pub outcome: String,
pub c_time: NumberString,
pub u_time: NumberString,
pub extra: ExtraFields,
}Expand description
Private orders channel row.
OKX docs: https://www.okx.com/docs-v5/en/#order-book-trading-trade-ws-order-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.
tgt_ccy: StringTarget currency for quantity (spot currency-trade only).
base_ccy means the order size is in base currency;
quote_ccy means the order size is in quote currency.
ccy: StringMargin currency (for cross-margin orders; empty otherwise).
ord_id: StringOKX-assigned order ID.
cl_ord_id: StringClient-supplied order ID, if any.
tag: StringOrder tag.
px: NumberStringOrder price; empty for market orders.
sz: NumberStringOrder size.
notional_usd: NumberStringEstimated notional value of the order in USD.
ord_type: StringOrder type.
Documented values: market, limit, post_only, fok, ioc,
optimal_limit_ioc, mmp, mmp_and_post_only, op_fok, elp.
side: StringOrder side: buy or sell.
pos_side: StringPosition side: long, short, or net.
td_mode: StringTrade mode: cross, isolated, or cash.
acc_fill_sz: NumberStringAccumulated filled size.
fill_px: NumberStringFill price of the most recent fill in this push.
trade_id: StringTrade ID of the most recent fill.
fill_sz: NumberStringFill size of the most recent fill.
fill_time: NumberStringFill timestamp of the most recent fill (Unix milliseconds).
fill_pnl: NumberStringFill PnL of the most recent fill.
fill_fee: NumberStringFee charged for the most recent fill.
fill_fee_ccy: StringFee currency for the most recent fill.
fill_notional_usd: NumberStringFilled notional value in USD for the most recent fill.
fill_px_vol: NumberStringImplied volatility at fill (options only).
fill_px_usd: NumberStringUSD-denominated option price at fill (options only).
fill_mark_vol: NumberStringMark implied volatility at fill (options only).
fill_fwd_px: NumberStringForward price at fill (options only).
fill_mark_px: NumberStringMark price at fill (FUTURES, SWAP, OPTION).
fill_idx_px: NumberStringIndex price at fill.
exec_type: StringLiquidity role for the most recent fill: T (taker) or M (maker).
avg_px: NumberStringAverage fill price.
state: StringOrder state.
Documented values: live, partially_filled, filled, canceled, mmp_canceled.
lever: NumberStringLeverage.
attach_algo_cl_ord_id: StringClient-supplied attached algo order ID.
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.
fee_ccy: StringFee currency.
fee: NumberStringFee amount; negative means deducted, positive means maker rebate.
rebate_ccy: StringRebate currency.
rebate: NumberStringRebate amount (maker rebate).
pnl: NumberStringProfit and loss for closing orders.
source: StringOrder source (internal OKX field).
category: StringOrder category.
Documented values: normal, twap, adl, full_liquidation,
partial_liquidation, delivery, ddh, auto_conversion.
reduce_only: StringWhether this is a reduce-only order: "true" or "false".
is_tp_limit: StringWhether this is a TP limit order: "true" or "false".
cancel_source: StringSource that triggered the cancellation.
algo_cl_ord_id: StringClient-supplied algo order ID that triggered this order.
algo_id: StringOKX-assigned algo order ID that triggered this order.
amend_source: StringSource of the last amendment.
amend_result: StringResult of the last amendment.
-1: failure, 0: success, 1: auto-canceled, 2: auto-amended (options only).
req_id: StringClient-supplied request ID, echoed from the operation that caused this push.
code: StringError code; "0" on success.
msg: StringError message; empty on success.
px_type: StringPrice type for options: px (price), pxVol (IV), or pxUsd (USD price).
px_usd: NumberStringUSD-denominated option order price.
px_vol: NumberStringImplied-volatility option order price.
linked_algo_ord: ValueLinked algo order details (JSON object; empty when not linked).
attach_algo_ords: Vec<Value>Attached algo orders (TP/SL orders attached to this order).
stp_mode: StringSelf-trade prevention mode: cancel_maker, cancel_taker, or cancel_both.
trade_quote_ccy: StringQuote currency used for the trade (event contracts only).
last_px: NumberStringLast price at the time of the push.
outcome: StringSettlement outcome (event contracts only): yes or no.
c_time: NumberStringOrder creation time (Unix milliseconds).
u_time: NumberStringLast update time (Unix milliseconds).
extra: ExtraFieldsUnrecognized fields retained for forward compatibility.
Trait Implementations§
Source§impl Clone for OrderUpdate
impl Clone for OrderUpdate
Source§fn clone(&self) -> OrderUpdate
fn clone(&self) -> OrderUpdate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more