pub struct Order {
    pub side: Side,
    pub max_base_lots: i64,
    pub max_quote_lots: i64,
    pub client_order_id: u64,
    pub reduce_only: bool,
    pub time_in_force: u16,
    pub self_trade_behavior: SelfTradeBehavior,
    pub params: OrderParams,
}
Expand description

Perp order parameters

Fields

side: Sidemax_base_lots: i64

Max base lots to buy/sell.

max_quote_lots: i64

Max quote lots to pay/receive (not taking fees into account).

client_order_id: u64

Arbitrary user-controlled order id.

reduce_only: bool

Reduce only

time_in_force: u16

Number of seconds the order shall live, 0 meaning forever

self_trade_behavior: SelfTradeBehavior

Configure how matches with order of the same owner are handled

params: OrderParams

Order type specific params

Implementations

Convert an input expiry timestamp to a time_in_force value

Should this order be penalized with an extra fee?

Some programs opportunistically call ioc orders, wasting lots of compute. This is intended to encourage people to be smarter about it.

source

pub fn is_post_only(&self) -> bool

Is this order required to be posted to the orderbook? It will fail if it would take.

Order tree that this order should be added to

Compute the price_lots this order is currently at, as well as the price_data that would be stored in its OrderTree node if the order is posted to the orderbook.

pegging limit for oracle peg orders, otherwise -1

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Casts the value.
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Casts the value.
Casts the value.
Casts the value.

Returns the argument unchanged.

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

Calls U::from(self).

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

Performs the conversion.
Performs the conversion.
Casts the value.
Casts the value.
The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
Casts the value.
Casts the value.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Casts the value.
Casts the value.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Casts the value.
Casts the value.