IndexerOrder

Struct IndexerOrder 

pub struct IndexerOrder {
Show 13 fields pub order_id: Option<IndexerOrderId>, 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 builder_code_params: Option<BuilderCodeParameters>, pub order_router_address: String, pub twap_parameters: Option<TwapParameters>, pub good_til_oneof: Option<GoodTilOneof>,
}
Expand description

IndexerOrderV1 represents a single order belonging to a Subaccount for a particular ClobPair.

Fields§

§order_id: Option<IndexerOrderId>

The unique ID of this order. Meant to be unique across all orders.

§side: i32§quantums: u64

The size of this order in base quantums. Must be a multiple of ClobPair.StepBaseQuantums (where ClobPair.Id = orderId.ClobPairId).

§subticks: u64

The 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: i32

The time in force of this order.

§reduce_only: bool

Enforces 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: u32

Set 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: u64

conditional_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).

§builder_code_params: Option<BuilderCodeParameters>

builder_code_params is the metadata for the partner or builder of an order.

§order_router_address: String

order_router_address is the address of the order router that forwarded this order.

§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.

§good_til_oneof: Option<GoodTilOneof>

Information about when the order expires.

Implementations§

§

impl IndexerOrder

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 set_side(&mut self, value: Side)

Sets side to the provided enum value.

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)

Sets time_in_force to the provided enum value.

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)

Sets condition_type to the provided enum value.

Trait Implementations§

§

impl Clone for IndexerOrder

§

fn clone(&self) -> IndexerOrder

Returns a duplicate of the value. Read more
1.0.0§

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

Performs copy-assignment from source. Read more
§

impl Debug for IndexerOrder

§

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

Formats the value using the given formatter. Read more
§

impl Default for IndexerOrder

§

fn default() -> IndexerOrder

Returns the “default value” for a type. Read more
§

impl Message for IndexerOrder

§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
Source§

fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message to a buffer. Read more
Source§

fn encode_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message to a newly allocated buffer.
Source§

fn encode_length_delimited( &self, buf: &mut impl BufMut, ) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
Source§

fn encode_length_delimited_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
Source§

fn decode(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes an instance of the message from a buffer. Read more
Source§

fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes a length-delimited instance of the message from the buffer.
Source§

fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
Source§

fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.
§

impl Name for IndexerOrder

§

const NAME: &'static str = "IndexerOrder"

Simple name for this Message. This name is the same as it appears in the source .proto file, e.g. FooBar.
§

const PACKAGE: &'static str = "dydxprotocol.indexer.protocol.v1"

Package name this message type is contained in. They are domain-like and delimited by ., e.g. google.protobuf.
§

fn full_name() -> String

Fully-qualified unique name for this 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.
§

fn type_url() -> String

Type URL for this Message, which by default is the full name with a leading slash, but may also include a leading domain name, e.g. type.googleapis.com/google.profile.Person. This can be used when serializing into the google.protobuf.Any type.
§

impl PartialEq for IndexerOrder

§

fn eq(&self, other: &IndexerOrder) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl StructuralPartialEq for IndexerOrder

Auto Trait Implementations§

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

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

§

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
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

fn in_current_span(self) -> Instrumented<Self>

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

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

§

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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

§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<L> LayerExt<L> for L

§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in [Layered].
§

impl<M> MessageExt for M
where M: Message,

§

fn to_bytes(&self) -> Result<Vec<u8>, EncodeError>

Serialize this protobuf message as a byte vector.
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: 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
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: 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> Same for T

Source§

type Output = T

Should always be Self
§

impl<M> ToAny for M
where M: Name,

§

fn to_any(self) -> Any

Converts the type to prost_types::Any.
§

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

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

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

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

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

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.
§

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

§

impl<T> Ungil for T
where T: Send,