pub struct Order {Show 27 fields
pub order_id: u64,
pub symbol_id: u32,
pub client_order_id: String,
pub side: EnumValue<Side>,
pub status: EnumValue<OrderStatus>,
pub order_type: EnumValue<OrderType>,
pub time_in_force: EnumValue<TimeInForce>,
pub self_trade_prevention_mode: EnumValue<SelfTradePreventionMode>,
pub fee_asset: EnumValue<FeeAsset>,
pub post_only: bool,
pub orig_qty_scaled: i64,
pub cum_qty_scaled: i64,
pub leaves_qty_scaled: i64,
pub avg_price_ticks: i64,
pub price_ticks: i64,
pub created_ts_ns: u64,
pub terminal_ts_ns: u64,
pub terminal_reason_code: u32,
pub terminal_reason: String,
pub attached_risk: MessageField<AttachedRisk>,
pub origin: MessageField<OrderOrigin>,
pub market_client_ref_price_ticks: i64,
pub market_max_slippage_ticks: i32,
pub market_max_slippage_bps: i32,
pub version: u32,
pub batch_request_id: u64,
pub submitted_max_quote_debit_scaled: Option<i64>,
/* private fields */
}Expand description
§============================================================================= Connect/Proto-facing Messages (scaled ints, fixed64 IDs)
Order is the Connect-facing order view with compact binary fields.
Fields§
§order_id: u64Public order identifier as fixed64.
Field 1: order_id
symbol_id: u32Trading symbol numeric identifier.
Field 3: symbol_id
client_order_id: StringClient-provided id for idempotency/correlation (may be empty).
Field 4: client_order_id
side: EnumValue<Side>Order side.
Field 5: side
status: EnumValue<OrderStatus>Current order lifecycle status.
Field 6: status
order_type: EnumValue<OrderType>Order type.
Field 7: order_type
time_in_force: EnumValue<TimeInForce>Time-in-force policy.
Field 8: time_in_force
self_trade_prevention_mode: EnumValue<SelfTradePreventionMode>Self-trade prevention mode.
Field 9: self_trade_prevention_mode
fee_asset: EnumValue<FeeAsset>Fee asset selected for fills. This also determines the decode scale for fee_scaled and referral_share_scaled on user trade rows.
Field 10: fee_asset
post_only: boolTrue if the order was submitted as post-only (maker-only).
Field 11: post_only
orig_qty_scaled: i64Original order quantity scaled by the pair’s base_quantity_scale from GetSpotConfig for symbol_id.
Field 12: orig_qty_scaled
cum_qty_scaled: i64Cumulative filled quantity scaled by the pair’s base_quantity_scale from GetSpotConfig for symbol_id.
Field 13: cum_qty_scaled
leaves_qty_scaled: i64Remaining working quantity scaled by the pair’s base_quantity_scale from GetSpotConfig for symbol_id. Zero for terminal orders.
Field 20: leaves_qty_scaled
avg_price_ticks: i64Average fill price in quote units scaled by 1e6. Zero if no fills.
Field 14: avg_price_ticks
price_ticks: i64Limit price in quote units scaled by 1e6. Zero for MARKET orders.
Field 15: price_ticks
created_ts_ns: u64Creation timestamp in nanoseconds since epoch (UTC).
Field 16: created_ts_ns
terminal_ts_ns: u64Terminal timestamp in nanoseconds since epoch (UTC). Zero for open orders.
Field 17: terminal_ts_ns
terminal_reason_code: u32Terminal reason code for canceled/rejected orders. Zero for non-terminal orders.
Field 18: terminal_reason_code
terminal_reason: StringStable string for terminal_reason_code (e.g. “POST_ONLY_CROSS”, “USER_REQUEST”). Empty for non-terminal orders.
Field 19: terminal_reason
attached_risk: MessageField<AttachedRisk>Attached risk controls + runtime state on the parent order. Empty when no attached risk exists.
Field 21: attached_risk
origin: MessageField<OrderOrigin>Runtime lineage metadata (why the order exists and what generated it).
Field 22: origin
market_client_ref_price_ticks: i64Optional client-side reference price used for MARKET slippage protection, in quote units scaled by 1e6.
Field 23: market_client_ref_price_ticks
market_max_slippage_ticks: i32Optional MARKET max slippage as a price delta in 1e-6 quote-unit ticks.
Field 24: market_max_slippage_ticks
market_max_slippage_bps: i32Optional MARKET max slippage in basis points (1 bp = 0.01%).
Field 25: market_max_slippage_bps
version: u32Per-order state version. Starts at 1 and increases for every published state change. Use this field to reconcile API and realtime updates.
Field 26: version
batch_request_id: u64Batch-replace identity that admitted this order. Zero for other origins.
Field 27: batch_request_id
submitted_max_quote_debit_scaled: Option<i64>Submitted hard all-in quote debit limit, scaled by the pair’s quote_quantity_scale from GetSpotConfig. Present only when that sizing method was submitted.
Field 28: submitted_max_quote_debit_scaled
Implementations§
Source§impl Order
impl Order
Sourcepub fn with_submitted_max_quote_debit_scaled(self, value: i64) -> Self
pub fn with_submitted_max_quote_debit_scaled(self, value: i64) -> Self
Sets Self::submitted_max_quote_debit_scaled to Some(value), consuming and returning self.
Trait Implementations§
Source§impl DefaultInstance for Order
impl DefaultInstance for Order
Source§fn default_instance() -> &'static Self
fn default_instance() -> &'static Self
Source§impl<'de> Deserialize<'de> for Order
impl<'de> Deserialize<'de> for Order
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl ExtensionSet for Order
impl ExtensionSet for Order
Source§const PROTO_FQN: &'static str = "orders.v1.Order"
const PROTO_FQN: &'static str = "orders.v1.Order"
"google.protobuf.FieldOptions". Read moreSource§fn unknown_fields(&self) -> &UnknownFields
fn unknown_fields(&self) -> &UnknownFields
Source§fn unknown_fields_mut(&mut self) -> &mut UnknownFields
fn unknown_fields_mut(&mut self) -> &mut UnknownFields
Source§fn extension<C>(&self, ext: &Extension<C>) -> <C as ExtensionCodec>::Outputwhere
C: ExtensionCodec,
fn extension<C>(&self, ext: &Extension<C>) -> <C as ExtensionCodec>::Outputwhere
C: ExtensionCodec,
Source§fn set_extension<C>(
&mut self,
ext: &Extension<C>,
value: <C as ExtensionCodec>::Value,
)where
C: ExtensionCodec,
fn set_extension<C>(
&mut self,
ext: &Extension<C>,
value: <C as ExtensionCodec>::Value,
)where
C: ExtensionCodec,
Source§fn has_extension<C>(&self, ext: &Extension<C>) -> boolwhere
C: ExtensionCodec,
fn has_extension<C>(&self, ext: &Extension<C>) -> boolwhere
C: ExtensionCodec,
true if any record at the extension’s field number is present. Read moreSource§fn clear_extension<C>(&mut self, ext: &Extension<C>)where
C: ExtensionCodec,
fn clear_extension<C>(&mut self, ext: &Extension<C>)where
C: ExtensionCodec,
Source§fn extension_or_default<C>(
&self,
ext: &Extension<C>,
) -> <C as ExtensionCodec>::Valuewhere
C: ExtensionCodec<Output = Option<<C as ExtensionCodec>::Value>>,
<C as ExtensionCodec>::Value: Default,
fn extension_or_default<C>(
&self,
ext: &Extension<C>,
) -> <C as ExtensionCodec>::Valuewhere
C: ExtensionCodec<Output = Option<<C as ExtensionCodec>::Value>>,
<C as ExtensionCodec>::Value: Default,
[default = ...]
value if absent, or the type’s Default if no proto default was declared. Read moreSource§impl HasMessageView for Order
impl HasMessageView for Order
Source§type View<'a> = OrderView<'a>
type View<'a> = OrderView<'a>
Self, borrowing from a buffer with lifetime
'a.Source§type ViewHandle = OrderOwnedView
type ViewHandle = OrderOwnedView
'static owned-view handle for Self
(FooOwnedView).Source§fn decode_view(buf: &[u8]) -> Result<Self::View<'_>, DecodeError>
fn decode_view(buf: &[u8]) -> Result<Self::View<'_>, DecodeError>
Source§fn decode_view_with_options<'a>(
buf: &'a [u8],
opts: &DecodeOptions,
) -> Result<Self::View<'a>, DecodeError>
fn decode_view_with_options<'a>( buf: &'a [u8], opts: &DecodeOptions, ) -> Result<Self::View<'a>, DecodeError>
View under custom
DecodeOptions (recursion limit, max message
size, unknown-field limit). Read moreSource§fn decode_view_handle(bytes: Bytes) -> Result<Self::ViewHandle, DecodeError>
fn decode_view_handle(bytes: Bytes) -> Result<Self::ViewHandle, DecodeError>
Source§fn decode_view_handle_with_options(
bytes: Bytes,
opts: &DecodeOptions,
) -> Result<Self::ViewHandle, DecodeError>
fn decode_view_handle_with_options( bytes: Bytes, opts: &DecodeOptions, ) -> Result<Self::ViewHandle, DecodeError>
Source§impl Message for Order
impl Message for Order
Source§fn compute_size(&self, __cache: &mut SizeCache) -> u32
fn compute_size(&self, __cache: &mut SizeCache) -> u32
Returns the total encoded size in bytes.
The result is a u32; the protobuf specification requires all
messages to fit within 2 GiB (2,147,483,647 bytes), so a
compliant message will never overflow this type.
Source§fn write_to(&self, __cache: &mut SizeCache, buf: &mut impl BufMut)
fn write_to(&self, __cache: &mut SizeCache, buf: &mut impl BufMut)
cache (populated by a prior
compute_size call on the same cache). Read moreSource§fn merge_field(
&mut self,
tag: Tag,
buf: &mut impl Buf,
ctx: DecodeContext<'_>,
) -> Result<(), DecodeError>
fn merge_field( &mut self, tag: Tag, buf: &mut impl Buf, ctx: DecodeContext<'_>, ) -> Result<(), DecodeError>
buf. Read moreSource§fn encode(&self, buf: &mut impl BufMut)
fn encode(&self, buf: &mut impl BufMut)
Source§fn encode_with_cache(&self, cache: &mut SizeCache, buf: &mut impl BufMut)
fn encode_with_cache(&self, cache: &mut SizeCache, buf: &mut impl BufMut)
SizeCache, for
reuse across many encodes in a hot loop. Clears the cache first.Source§fn encoded_len(&self) -> u32
fn encoded_len(&self) -> u32
Source§fn encode_length_delimited(&self, buf: &mut impl BufMut)
fn encode_length_delimited(&self, buf: &mut impl BufMut)
Source§fn encode_to_bytes(&self) -> Bytes
fn encode_to_bytes(&self) -> Bytes
bytes::Bytes. Read moreSource§fn decode(buf: &mut impl Buf) -> Result<Self, DecodeError>where
Self: Sized,
fn decode(buf: &mut impl Buf) -> Result<Self, DecodeError>where
Self: Sized,
Source§fn decode_from_slice(data: &[u8]) -> Result<Self, DecodeError>where
Self: Sized,
fn decode_from_slice(data: &[u8]) -> Result<Self, DecodeError>where
Self: Sized,
Source§fn decode_length_delimited(buf: &mut impl Buf) -> Result<Self, DecodeError>where
Self: Sized,
fn decode_length_delimited(buf: &mut impl Buf) -> Result<Self, DecodeError>where
Self: Sized,
Source§fn merge_to_limit(
&mut self,
buf: &mut impl Buf,
ctx: DecodeContext<'_>,
limit: usize,
) -> Result<(), DecodeError>
fn merge_to_limit( &mut self, buf: &mut impl Buf, ctx: DecodeContext<'_>, limit: usize, ) -> Result<(), DecodeError>
Source§fn merge_group(
&mut self,
buf: &mut impl Buf,
ctx: DecodeContext<'_>,
field_number: u32,
) -> Result<(), DecodeError>
fn merge_group( &mut self, buf: &mut impl Buf, ctx: DecodeContext<'_>, field_number: u32, ) -> Result<(), DecodeError>
buf, reading fields until an
EndGroup tag with the given field_number is encountered. Read moreSource§fn merge(
&mut self,
buf: &mut impl Buf,
ctx: DecodeContext<'_>,
) -> Result<(), DecodeError>
fn merge( &mut self, buf: &mut impl Buf, ctx: DecodeContext<'_>, ) -> Result<(), DecodeError>
Source§fn merge_from_slice(&mut self, data: &[u8]) -> Result<(), DecodeError>
fn merge_from_slice(&mut self, data: &[u8]) -> Result<(), DecodeError>
Source§fn merge_length_delimited(
&mut self,
buf: &mut impl Buf,
ctx: DecodeContext<'_>,
) -> Result<(), DecodeError>
fn merge_length_delimited( &mut self, buf: &mut impl Buf, ctx: DecodeContext<'_>, ) -> Result<(), DecodeError>
Source§impl MessageName for Order
impl MessageName for Order
Source§const PACKAGE: &'static str = "orders.v1"
const PACKAGE: &'static str = "orders.v1"
Source§const NAME: &'static str = "Order"
const NAME: &'static str = "Order"
. between nesting levels. Read moreSource§impl ProtoElemJson for Order
impl ProtoElemJson for Order
Source§fn serialize_proto_json<S: Serializer>(
v: &Self,
s: S,
) -> Result<S::Ok, S::Error>
fn serialize_proto_json<S: Serializer>( v: &Self, s: S, ) -> Result<S::Ok, S::Error>
Source§fn deserialize_proto_json<'de, D: Deserializer<'de>>(
d: D,
) -> Result<Self, D::Error>
fn deserialize_proto_json<'de, D: Deserializer<'de>>( d: D, ) -> Result<Self, D::Error>
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 UnsafeUnpin for Order
impl UnwindSafe for Order
Blanket Implementations§
Source§impl<T> AnyMessage for Twhere
T: Message + JsonSerialize + 'static,
impl<T> AnyMessage for Twhere
T: Message + JsonSerialize + 'static,
Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
dyn Any for downcasting.Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Any> for owned downcasting. Read moreSource§fn encode(&self, format: CodecFormat) -> Result<Bytes, ConnectError>
fn encode(&self, format: CodecFormat) -> Result<Bytes, ConnectError>
Source§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
std::any::type_name.Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<M> Encodable<M> for Mwhere
M: Message + JsonSerialize,
impl<M> Encodable<M> for Mwhere
M: Message + JsonSerialize,
Source§fn encode(&self, codec: CodecFormat) -> Result<Bytes, ConnectError>
fn encode(&self, codec: CodecFormat) -> Result<Bytes, ConnectError>
self as wire bytes for M in the requested format.