Struct Order
pub struct Order {Show 13 fields
pub order_id: Option<OrderId>,
pub side: i32,
pub quantums: u64,
pub subticks: u64,
pub time_in_force: i32,
pub reduce_only: bool,
pub client_metadata: u32,
pub condition_type: i32,
pub conditional_order_trigger_subticks: u64,
pub twap_parameters: Option<TwapParameters>,
pub builder_code_parameters: Option<BuilderCodeParameters>,
pub order_router_address: String,
pub good_til_oneof: Option<GoodTilOneof>,
}Expand description
Order represents a single order belonging to a Subaccount
for a particular ClobPair.
Fields§
§order_id: Option<OrderId>The unique ID of this order. Meant to be unique across all orders.
side: i32§quantums: u64The size of this order in base quantums. Must be a multiple of
ClobPair.StepBaseQuantums (where ClobPair.Id = orderId.ClobPairId).
subticks: u64The price level that this order will be placed at on the orderbook,
in subticks. Must be a multiple of ClobPair.SubticksPerTick
(where ClobPair.Id = orderId.ClobPairId).
time_in_force: i32The time in force of this order.
reduce_only: boolEnforces that the order can only reduce the size of an existing position. If a ReduceOnly order would change the side of the existing position, its size is reduced to that of the remaining size of the position. If existing orders on the book with ReduceOnly would already close the position, the least aggressive (out-of-the-money) ReduceOnly orders are resized and canceled first.
client_metadata: u32Set of bit flags set arbitrarily by clients and ignored by the protocol. Used by indexer to infer information about a placed order.
condition_type: i32§conditional_order_trigger_subticks: u64conditional_order_trigger_subticks represents the price at which this order
will be triggered. If the condition_type is CONDITION_TYPE_UNSPECIFIED,
this value is enforced to be 0. If this value is nonzero, condition_type
cannot be CONDITION_TYPE_UNSPECIFIED. Value is in subticks.
Must be a multiple of ClobPair.SubticksPerTick (where ClobPair.Id = orderId.ClobPairId).
twap_parameters: Option<TwapParameters>twap_parameters represent the configuration for a TWAP order. This must be set for twap orders and will be ignored for all other order types.
builder_code_parameters: Option<BuilderCodeParameters>builder_code_parameters is the metadata for the partner or builder of an order specifying the fees charged.
order_router_address: Stringorder_router_address is the address of the order router that placed the order.
good_til_oneof: Option<GoodTilOneof>Information about when the order expires.
Implementations§
§impl Order
impl Order
pub fn side(&self) -> Side
pub fn side(&self) -> Side
Returns the enum value of side, or the default if the field is set to an invalid enum value.
pub fn time_in_force(&self) -> TimeInForce
pub fn time_in_force(&self) -> TimeInForce
Returns the enum value of time_in_force, or the default if the field is set to an invalid enum value.
pub fn set_time_in_force(&mut self, value: TimeInForce)
pub fn set_time_in_force(&mut self, value: TimeInForce)
Sets time_in_force to the provided enum value.
pub fn condition_type(&self) -> ConditionType
pub fn condition_type(&self) -> ConditionType
Returns the enum value of condition_type, or the default if the field is set to an invalid enum value.
pub fn set_condition_type(&mut self, value: ConditionType)
pub fn set_condition_type(&mut self, value: ConditionType)
Sets condition_type to the provided enum value.
Trait Implementations§
§impl Message for Order
impl Message for Order
§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.§impl Name for Order
impl Name for Order
§const NAME: &'static str = "Order"
const NAME: &'static str = "Order"
Message.
This name is the same as it appears in the source .proto file, e.g. FooBar.§const PACKAGE: &'static str = "dydxprotocol.clob"
const PACKAGE: &'static str = "dydxprotocol.clob"
., e.g. google.protobuf.§fn full_name() -> String
fn full_name() -> String
Message.
It’s prefixed with the package name and names of any parent messages,
e.g. google.rpc.BadRequest.FieldViolation.
By default, this is the package name followed by the message name.
Fully-qualified names must be unique within a domain of Type URLs.impl StructuralPartialEq for Order
Auto Trait Implementations§
impl Freeze for Order
impl RefUnwindSafe for Order
impl Send for Order
impl Sync for Order
impl Unpin for Order
impl UnwindSafe for Order
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].