Skip to main content

Order

Struct Order 

Source
#[non_exhaustive]
pub struct Order {
Show 53 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 px_usd: NumberString, pub px_vol: NumberString, pub px_type: String, pub sz: NumberString, pub pnl: NumberString, pub ord_type: OrderType, pub side: OrderSide, pub pos_side: PositionSide, pub td_mode: TradeMode, pub acc_fill_sz: NumberString, pub fill_px: NumberString, pub trade_id: String, pub fill_sz: NumberString, pub fill_time: NumberString, pub avg_px: NumberString, pub state: OrderState, pub stp_id: String, pub stp_mode: 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 attach_algo_ords: Vec<OrderAttachAlgoOrder>, pub linked_algo_ord: Option<OrderLinkedAlgoOrder>, pub fee_ccy: String, pub fee: NumberString, pub rebate_ccy: String, pub rebate: NumberString, pub source: String, pub category: String, pub reduce_only: String, pub is_tp_limit: String, pub cancel_source: String, pub cancel_source_reason: String, pub quick_mgn_type: String, pub algo_cl_ord_id: String, pub algo_id: String, pub u_time: NumberString, pub c_time: NumberString, pub trade_quote_ccy: String, pub outcome: String,
}
Expand description

Details of an existing order.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§inst_type: String

Instrument type.

§inst_id: String

Instrument ID.

§tgt_ccy: String

Order quantity unit setting for spot market orders (tgtCcy).

§ccy: String

Margin currency.

§ord_id: String

OKX order ID.

§cl_ord_id: String

Client-supplied order ID, if any.

§tag: String

Order tag.

§px: NumberString

Order price.

§px_usd: NumberString

Order price in USD (options).

§px_vol: NumberString

Implied volatility of the order price (options).

§px_type: String

Price type (px/pxVol/pxUsd).

§sz: NumberString

Order size.

§pnl: NumberString

Profit and loss.

§ord_type: OrderType

Order type.

§side: OrderSide

Order side.

§pos_side: PositionSide

Position side.

§td_mode: TradeMode

Trade mode.

§acc_fill_sz: NumberString

Accumulated filled size.

§fill_px: NumberString

Last fill price.

§trade_id: String

Last trade ID.

§fill_sz: NumberString

Last filled size.

§fill_time: NumberString

Last fill time (Unix milliseconds).

§avg_px: NumberString

Average fill price.

§state: OrderState

Order state.

§stp_id: String

Self-trade prevention ID.

§stp_mode: String

Self-trade prevention mode.

§lever: NumberString

Leverage.

§attach_algo_cl_ord_id: String

Client-supplied ID of the attached SL/TP order.

§tp_trigger_px: NumberString

Take-profit trigger price.

§tp_trigger_px_type: String

Take-profit trigger price type.

§tp_ord_px: NumberString

Take-profit order price.

§sl_trigger_px: NumberString

Stop-loss trigger price.

§sl_trigger_px_type: String

Stop-loss trigger price type.

§sl_ord_px: NumberString

Stop-loss order price.

§attach_algo_ords: Vec<OrderAttachAlgoOrder>

Attached SL/TP algo orders.

§linked_algo_ord: Option<OrderLinkedAlgoOrder>

Linked algo order, if any.

§fee_ccy: String

Fee currency.

§fee: NumberString

Fee amount.

§rebate_ccy: String

Rebate currency.

§rebate: NumberString

Rebate amount.

§source: String

Order source.

§category: String

Order category.

§reduce_only: String

Whether the order is reduce-only ("true"/"false").

§is_tp_limit: String

Whether the take-profit order is a limit order.

§cancel_source: String

Cancellation source.

§cancel_source_reason: String

Cancellation source reason.

§quick_mgn_type: String

Quick margin type.

§algo_cl_ord_id: String

Client-supplied algo order ID.

§algo_id: String

Algo order ID.

§u_time: NumberString

Update time (Unix milliseconds).

§c_time: NumberString

Creation time (Unix milliseconds).

§trade_quote_ccy: String

Trade quote currency.

§outcome: String

Order outcome.

Trait Implementations§

Source§

impl Clone for Order

Source§

fn clone(&self) -> Order

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Order

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Order

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

§

impl Freeze for Order

§

impl RefUnwindSafe for Order

§

impl Send for Order

§

impl Sync for Order

§

impl Unpin for Order

§

impl UnsafeUnpin for Order

§

impl UnwindSafe for Order

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more