Skip to main content

dydx_proto/opt/rustwide/workdir/src/
dydxprotocol.clob.rs

1// This file is @generated by prost-build.
2/// Defines the block rate limits for CLOB specific operations.
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct BlockRateLimitConfiguration {
5    /// How many short term order attempts (successful and failed) are allowed for
6    /// an account per N blocks. Note that the rate limits are applied
7    /// in an AND fashion such that an order placement must pass all rate limit
8    /// configurations.
9    ///
10    /// Specifying 0 values disables this rate limit.
11    /// Deprecated in favor of `max_short_term_orders_and_cancels_per_n_blocks`
12    /// for v5.x onwards.
13    #[deprecated]
14    #[prost(message, repeated, tag = "1")]
15    pub max_short_term_orders_per_n_blocks: ::prost::alloc::vec::Vec<
16        MaxPerNBlocksRateLimit,
17    >,
18    /// How many stateful order attempts (successful and failed) are allowed for
19    /// an account per N blocks. Note that the rate limits are applied
20    /// in an AND fashion such that an order placement must pass all rate limit
21    /// configurations.
22    ///
23    /// Specifying 0 values disables this rate limit.
24    #[prost(message, repeated, tag = "2")]
25    pub max_stateful_orders_per_n_blocks: ::prost::alloc::vec::Vec<
26        MaxPerNBlocksRateLimit,
27    >,
28    /// How many short term order cancellation attempts (successful and failed) are
29    /// allowed for an account per N blocks. Note that the rate limits are
30    /// applied in an AND fashion such that an order cancellation must pass all
31    /// rate limit configurations.
32    ///
33    /// Specifying 0 values disables this rate limit.
34    /// Deprecated in favor of `max_short_term_orders_and_cancels_per_n_blocks`
35    /// for v5.x onwards.
36    #[deprecated]
37    #[prost(message, repeated, tag = "3")]
38    pub max_short_term_order_cancellations_per_n_blocks: ::prost::alloc::vec::Vec<
39        MaxPerNBlocksRateLimit,
40    >,
41    /// How many short term order place and cancel attempts (successful and failed)
42    /// are allowed for an account per N blocks. Note that the rate limits are
43    /// applied in an AND fashion such that an order placement must pass all rate
44    /// limit configurations.
45    ///
46    /// Specifying 0 values disables this rate limit.
47    #[prost(message, repeated, tag = "4")]
48    pub max_short_term_orders_and_cancels_per_n_blocks: ::prost::alloc::vec::Vec<
49        MaxPerNBlocksRateLimit,
50    >,
51}
52impl ::prost::Name for BlockRateLimitConfiguration {
53    const NAME: &'static str = "BlockRateLimitConfiguration";
54    const PACKAGE: &'static str = "dydxprotocol.clob";
55    fn full_name() -> ::prost::alloc::string::String {
56        "dydxprotocol.clob.BlockRateLimitConfiguration".into()
57    }
58    fn type_url() -> ::prost::alloc::string::String {
59        "/dydxprotocol.clob.BlockRateLimitConfiguration".into()
60    }
61}
62/// Defines a rate limit over a specific number of blocks.
63#[derive(Clone, Copy, PartialEq, ::prost::Message)]
64pub struct MaxPerNBlocksRateLimit {
65    /// How many blocks the rate limit is over.
66    /// Specifying 0 is invalid.
67    #[prost(uint32, tag = "1")]
68    pub num_blocks: u32,
69    /// What the limit is for `num_blocks`.
70    /// Specifying 0 is invalid.
71    #[prost(uint32, tag = "2")]
72    pub limit: u32,
73}
74impl ::prost::Name for MaxPerNBlocksRateLimit {
75    const NAME: &'static str = "MaxPerNBlocksRateLimit";
76    const PACKAGE: &'static str = "dydxprotocol.clob";
77    fn full_name() -> ::prost::alloc::string::String {
78        "dydxprotocol.clob.MaxPerNBlocksRateLimit".into()
79    }
80    fn type_url() -> ::prost::alloc::string::String {
81        "/dydxprotocol.clob.MaxPerNBlocksRateLimit".into()
82    }
83}
84/// PerpetualClobMetadata contains metadata for a `ClobPair`
85/// representing a Perpetual product.
86#[derive(Clone, Copy, PartialEq, ::prost::Message)]
87pub struct PerpetualClobMetadata {
88    /// Id of the Perpetual the CLOB allows trading of.
89    #[prost(uint32, tag = "1")]
90    pub perpetual_id: u32,
91}
92impl ::prost::Name for PerpetualClobMetadata {
93    const NAME: &'static str = "PerpetualClobMetadata";
94    const PACKAGE: &'static str = "dydxprotocol.clob";
95    fn full_name() -> ::prost::alloc::string::String {
96        "dydxprotocol.clob.PerpetualClobMetadata".into()
97    }
98    fn type_url() -> ::prost::alloc::string::String {
99        "/dydxprotocol.clob.PerpetualClobMetadata".into()
100    }
101}
102/// PerpetualClobMetadata contains metadata for a `ClobPair`
103/// representing a Spot product.
104#[derive(Clone, Copy, PartialEq, ::prost::Message)]
105pub struct SpotClobMetadata {
106    /// Id of the base Asset in the trading pair.
107    #[prost(uint32, tag = "1")]
108    pub base_asset_id: u32,
109    /// Id of the quote Asset in the trading pair.
110    #[prost(uint32, tag = "2")]
111    pub quote_asset_id: u32,
112}
113impl ::prost::Name for SpotClobMetadata {
114    const NAME: &'static str = "SpotClobMetadata";
115    const PACKAGE: &'static str = "dydxprotocol.clob";
116    fn full_name() -> ::prost::alloc::string::String {
117        "dydxprotocol.clob.SpotClobMetadata".into()
118    }
119    fn type_url() -> ::prost::alloc::string::String {
120        "/dydxprotocol.clob.SpotClobMetadata".into()
121    }
122}
123/// ClobPair represents a single CLOB pair for a given product
124/// in state.
125#[derive(Clone, Copy, PartialEq, ::prost::Message)]
126pub struct ClobPair {
127    /// ID of the orderbook that stores all resting liquidity for this CLOB.
128    #[prost(uint32, tag = "1")]
129    pub id: u32,
130    /// Minimum increment in the size of orders on the CLOB, in base quantums.
131    #[prost(uint64, tag = "4")]
132    pub step_base_quantums: u64,
133    /// Defines the tick size of the orderbook by defining how many subticks
134    /// are in one tick. That is, the subticks of any valid order must be a
135    /// multiple of this value. Generally this value should start `>= 100`to
136    /// allow room for decreasing it.
137    #[prost(uint32, tag = "5")]
138    pub subticks_per_tick: u32,
139    /// `10^Exponent` gives the number of QuoteQuantums traded per BaseQuantum
140    /// per Subtick.
141    #[prost(sint32, tag = "6")]
142    pub quantum_conversion_exponent: i32,
143    #[prost(enumeration = "clob_pair::Status", tag = "7")]
144    pub status: i32,
145    /// Product-specific metadata. Perpetual CLOBs will have
146    /// PerpetualClobMetadata, and Spot CLOBs will have SpotClobMetadata.
147    #[prost(oneof = "clob_pair::Metadata", tags = "2, 3")]
148    pub metadata: ::core::option::Option<clob_pair::Metadata>,
149}
150/// Nested message and enum types in `ClobPair`.
151pub mod clob_pair {
152    /// Status of the CLOB.
153    #[derive(
154        Clone,
155        Copy,
156        Debug,
157        PartialEq,
158        Eq,
159        Hash,
160        PartialOrd,
161        Ord,
162        ::prost::Enumeration
163    )]
164    #[repr(i32)]
165    pub enum Status {
166        /// Default value. This value is invalid and unused.
167        Unspecified = 0,
168        /// STATUS_ACTIVE represents an active clob pair.
169        Active = 1,
170        /// STATUS_PAUSED behavior is unfinalized.
171        /// TODO(DEC-600): update this documentation.
172        Paused = 2,
173        /// STATUS_CANCEL_ONLY behavior is unfinalized.
174        /// TODO(DEC-600): update this documentation.
175        CancelOnly = 3,
176        /// STATUS_POST_ONLY behavior is unfinalized.
177        /// TODO(DEC-600): update this documentation.
178        PostOnly = 4,
179        /// STATUS_INITIALIZING represents a newly-added clob pair.
180        /// Clob pairs in this state only accept orders which are
181        /// both short-term and post-only.
182        Initializing = 5,
183        /// STATUS_FINAL_SETTLEMENT represents a clob pair which is deactivated
184        /// and trading has ceased. All open positions will be closed by the
185        /// protocol. Open stateful orders will be cancelled. Open short-term
186        /// orders will be left to expire.
187        FinalSettlement = 6,
188    }
189    impl Status {
190        /// String value of the enum field names used in the ProtoBuf definition.
191        ///
192        /// The values are not transformed in any way and thus are considered stable
193        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
194        pub fn as_str_name(&self) -> &'static str {
195            match self {
196                Self::Unspecified => "STATUS_UNSPECIFIED",
197                Self::Active => "STATUS_ACTIVE",
198                Self::Paused => "STATUS_PAUSED",
199                Self::CancelOnly => "STATUS_CANCEL_ONLY",
200                Self::PostOnly => "STATUS_POST_ONLY",
201                Self::Initializing => "STATUS_INITIALIZING",
202                Self::FinalSettlement => "STATUS_FINAL_SETTLEMENT",
203            }
204        }
205        /// Creates an enum from field names used in the ProtoBuf definition.
206        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
207            match value {
208                "STATUS_UNSPECIFIED" => Some(Self::Unspecified),
209                "STATUS_ACTIVE" => Some(Self::Active),
210                "STATUS_PAUSED" => Some(Self::Paused),
211                "STATUS_CANCEL_ONLY" => Some(Self::CancelOnly),
212                "STATUS_POST_ONLY" => Some(Self::PostOnly),
213                "STATUS_INITIALIZING" => Some(Self::Initializing),
214                "STATUS_FINAL_SETTLEMENT" => Some(Self::FinalSettlement),
215                _ => None,
216            }
217        }
218    }
219    /// Product-specific metadata. Perpetual CLOBs will have
220    /// PerpetualClobMetadata, and Spot CLOBs will have SpotClobMetadata.
221    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
222    pub enum Metadata {
223        #[prost(message, tag = "2")]
224        PerpetualClobMetadata(super::PerpetualClobMetadata),
225        #[prost(message, tag = "3")]
226        SpotClobMetadata(super::SpotClobMetadata),
227    }
228}
229impl ::prost::Name for ClobPair {
230    const NAME: &'static str = "ClobPair";
231    const PACKAGE: &'static str = "dydxprotocol.clob";
232    fn full_name() -> ::prost::alloc::string::String {
233        "dydxprotocol.clob.ClobPair".into()
234    }
235    fn type_url() -> ::prost::alloc::string::String {
236        "/dydxprotocol.clob.ClobPair".into()
237    }
238}
239/// Defines the set of equity tiers to limit how many open orders
240/// a subaccount is allowed to have.
241#[derive(Clone, PartialEq, ::prost::Message)]
242pub struct EquityTierLimitConfiguration {
243    /// How many short term stateful orders are allowed per equity tier.
244    /// Specifying 0 values disables this limit.
245    #[prost(message, repeated, tag = "1")]
246    pub short_term_order_equity_tiers: ::prost::alloc::vec::Vec<EquityTierLimit>,
247    /// How many open stateful orders are allowed per equity tier.
248    /// Specifying 0 values disables this limit.
249    #[prost(message, repeated, tag = "2")]
250    pub stateful_order_equity_tiers: ::prost::alloc::vec::Vec<EquityTierLimit>,
251}
252impl ::prost::Name for EquityTierLimitConfiguration {
253    const NAME: &'static str = "EquityTierLimitConfiguration";
254    const PACKAGE: &'static str = "dydxprotocol.clob";
255    fn full_name() -> ::prost::alloc::string::String {
256        "dydxprotocol.clob.EquityTierLimitConfiguration".into()
257    }
258    fn type_url() -> ::prost::alloc::string::String {
259        "/dydxprotocol.clob.EquityTierLimitConfiguration".into()
260    }
261}
262/// Defines an equity tier limit.
263#[derive(Clone, PartialEq, ::prost::Message)]
264pub struct EquityTierLimit {
265    /// The total net collateral in USDC quote quantums of equity required.
266    #[prost(bytes = "vec", tag = "1")]
267    pub usd_tnc_required: ::prost::alloc::vec::Vec<u8>,
268    /// What the limit is for `usd_tnc_required`.
269    #[prost(uint32, tag = "2")]
270    pub limit: u32,
271}
272impl ::prost::Name for EquityTierLimit {
273    const NAME: &'static str = "EquityTierLimit";
274    const PACKAGE: &'static str = "dydxprotocol.clob";
275    fn full_name() -> ::prost::alloc::string::String {
276        "dydxprotocol.clob.EquityTierLimit".into()
277    }
278    fn type_url() -> ::prost::alloc::string::String {
279        "/dydxprotocol.clob.EquityTierLimit".into()
280    }
281}
282/// ClobStagedFinalizeBlockEvent defines a CLOB event staged during
283/// FinalizeBlock.
284#[derive(Clone, Copy, PartialEq, ::prost::Message)]
285pub struct ClobStagedFinalizeBlockEvent {
286    /// event is the staged event.
287    #[prost(oneof = "clob_staged_finalize_block_event::Event", tags = "1")]
288    pub event: ::core::option::Option<clob_staged_finalize_block_event::Event>,
289}
290/// Nested message and enum types in `ClobStagedFinalizeBlockEvent`.
291pub mod clob_staged_finalize_block_event {
292    /// event is the staged event.
293    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
294    pub enum Event {
295        /// create_clob_pair indicates a new CLOB pair creation.
296        #[prost(message, tag = "1")]
297        CreateClobPair(super::ClobPair),
298    }
299}
300impl ::prost::Name for ClobStagedFinalizeBlockEvent {
301    const NAME: &'static str = "ClobStagedFinalizeBlockEvent";
302    const PACKAGE: &'static str = "dydxprotocol.clob";
303    fn full_name() -> ::prost::alloc::string::String {
304        "dydxprotocol.clob.ClobStagedFinalizeBlockEvent".into()
305    }
306    fn type_url() -> ::prost::alloc::string::String {
307        "/dydxprotocol.clob.ClobStagedFinalizeBlockEvent".into()
308    }
309}
310/// LiquidationsConfig stores all configurable fields related to liquidations.
311#[derive(Clone, Copy, PartialEq, ::prost::Message)]
312pub struct LiquidationsConfig {
313    /// The maximum liquidation fee (in parts-per-million). This fee goes
314    /// 100% to the insurance fund.
315    #[prost(uint32, tag = "1")]
316    pub max_liquidation_fee_ppm: u32,
317    /// Limits around how much of a single position can be liquidated
318    /// within a single block.
319    #[prost(message, optional, tag = "2")]
320    pub position_block_limits: ::core::option::Option<PositionBlockLimits>,
321    /// Limits around how many quote quantums from a single subaccount can
322    /// be liquidated within a single block.
323    #[prost(message, optional, tag = "3")]
324    pub subaccount_block_limits: ::core::option::Option<SubaccountBlockLimits>,
325    /// Config about how the fillable-price spread from the oracle price
326    /// increases based on the adjusted bankruptcy rating of the subaccount.
327    #[prost(message, optional, tag = "4")]
328    pub fillable_price_config: ::core::option::Option<FillablePriceConfig>,
329}
330impl ::prost::Name for LiquidationsConfig {
331    const NAME: &'static str = "LiquidationsConfig";
332    const PACKAGE: &'static str = "dydxprotocol.clob";
333    fn full_name() -> ::prost::alloc::string::String {
334        "dydxprotocol.clob.LiquidationsConfig".into()
335    }
336    fn type_url() -> ::prost::alloc::string::String {
337        "/dydxprotocol.clob.LiquidationsConfig".into()
338    }
339}
340/// PositionBlockLimits stores all configurable fields related to limits
341/// around how much of a single position can be liquidated within a single block.
342#[derive(Clone, Copy, PartialEq, ::prost::Message)]
343pub struct PositionBlockLimits {
344    /// The minimum amount of quantums to liquidate for each message (in
345    /// quote quantums).
346    /// Overridden by the maximum size of the position.
347    #[prost(uint64, tag = "1")]
348    pub min_position_notional_liquidated: u64,
349    /// The maximum portion of the position liquidated (in parts-per-
350    /// million). Overridden by min_position_notional_liquidated.
351    #[prost(uint32, tag = "2")]
352    pub max_position_portion_liquidated_ppm: u32,
353}
354impl ::prost::Name for PositionBlockLimits {
355    const NAME: &'static str = "PositionBlockLimits";
356    const PACKAGE: &'static str = "dydxprotocol.clob";
357    fn full_name() -> ::prost::alloc::string::String {
358        "dydxprotocol.clob.PositionBlockLimits".into()
359    }
360    fn type_url() -> ::prost::alloc::string::String {
361        "/dydxprotocol.clob.PositionBlockLimits".into()
362    }
363}
364/// SubaccountBlockLimits stores all configurable fields related to limits
365/// around how many quote quantums from a single subaccount can
366/// be liquidated within a single block.
367#[derive(Clone, Copy, PartialEq, ::prost::Message)]
368pub struct SubaccountBlockLimits {
369    /// The maximum notional amount that a single subaccount can have
370    /// liquidated (in quote quantums) per block.
371    #[prost(uint64, tag = "1")]
372    pub max_notional_liquidated: u64,
373    /// The maximum insurance-fund payout amount for a given subaccount
374    /// per block. I.e. how much it can cover for that subaccount.
375    #[prost(uint64, tag = "2")]
376    pub max_quantums_insurance_lost: u64,
377}
378impl ::prost::Name for SubaccountBlockLimits {
379    const NAME: &'static str = "SubaccountBlockLimits";
380    const PACKAGE: &'static str = "dydxprotocol.clob";
381    fn full_name() -> ::prost::alloc::string::String {
382        "dydxprotocol.clob.SubaccountBlockLimits".into()
383    }
384    fn type_url() -> ::prost::alloc::string::String {
385        "/dydxprotocol.clob.SubaccountBlockLimits".into()
386    }
387}
388/// FillablePriceConfig stores all configurable fields related to calculating
389/// the fillable price for liquidating a position.
390#[derive(Clone, Copy, PartialEq, ::prost::Message)]
391pub struct FillablePriceConfig {
392    /// The rate at which the Adjusted Bankruptcy Rating increases.
393    #[prost(uint32, tag = "1")]
394    pub bankruptcy_adjustment_ppm: u32,
395    /// The maximum value that the liquidation spread can take, as
396    /// a ratio against the position's maintenance margin.
397    #[prost(uint32, tag = "2")]
398    pub spread_to_maintenance_margin_ratio_ppm: u32,
399}
400impl ::prost::Name for FillablePriceConfig {
401    const NAME: &'static str = "FillablePriceConfig";
402    const PACKAGE: &'static str = "dydxprotocol.clob";
403    fn full_name() -> ::prost::alloc::string::String {
404        "dydxprotocol.clob.FillablePriceConfig".into()
405    }
406    fn type_url() -> ::prost::alloc::string::String {
407        "/dydxprotocol.clob.FillablePriceConfig".into()
408    }
409}
410/// GenesisState defines the clob module's genesis state.
411#[derive(Clone, PartialEq, ::prost::Message)]
412pub struct GenesisState {
413    #[prost(message, repeated, tag = "1")]
414    pub clob_pairs: ::prost::alloc::vec::Vec<ClobPair>,
415    #[prost(message, optional, tag = "2")]
416    pub liquidations_config: ::core::option::Option<LiquidationsConfig>,
417    #[prost(message, optional, tag = "3")]
418    pub block_rate_limit_config: ::core::option::Option<BlockRateLimitConfiguration>,
419    #[prost(message, optional, tag = "4")]
420    pub equity_tier_limit_config: ::core::option::Option<EquityTierLimitConfiguration>,
421}
422impl ::prost::Name for GenesisState {
423    const NAME: &'static str = "GenesisState";
424    const PACKAGE: &'static str = "dydxprotocol.clob";
425    fn full_name() -> ::prost::alloc::string::String {
426        "dydxprotocol.clob.GenesisState".into()
427    }
428    fn type_url() -> ::prost::alloc::string::String {
429        "/dydxprotocol.clob.GenesisState".into()
430    }
431}
432/// PerpetualLiquidationInfo holds information about a liquidation that occurred
433/// for a position held by a subaccount.
434/// Note this proto is defined to make it easier to hash
435/// the metadata of a liquidation, and is never written to state.
436#[derive(Clone, PartialEq, ::prost::Message)]
437pub struct PerpetualLiquidationInfo {
438    /// The id of the subaccount that got liquidated/deleveraged or was deleveraged
439    /// onto.
440    #[prost(message, optional, tag = "1")]
441    pub subaccount_id: ::core::option::Option<super::subaccounts::SubaccountId>,
442    /// The id of the perpetual involved.
443    #[prost(uint32, tag = "2")]
444    pub perpetual_id: u32,
445}
446impl ::prost::Name for PerpetualLiquidationInfo {
447    const NAME: &'static str = "PerpetualLiquidationInfo";
448    const PACKAGE: &'static str = "dydxprotocol.clob";
449    fn full_name() -> ::prost::alloc::string::String {
450        "dydxprotocol.clob.PerpetualLiquidationInfo".into()
451    }
452    fn type_url() -> ::prost::alloc::string::String {
453        "/dydxprotocol.clob.PerpetualLiquidationInfo".into()
454    }
455}
456/// SubaccountLiquidationInfo holds liquidation information per-subaccount in the
457/// current block.
458#[derive(Clone, PartialEq, ::prost::Message)]
459pub struct SubaccountLiquidationInfo {
460    /// An unsorted list of unique perpetual IDs that the subaccount has previously
461    /// liquidated.
462    #[prost(uint32, repeated, tag = "1")]
463    pub perpetuals_liquidated: ::prost::alloc::vec::Vec<u32>,
464    /// The notional value (in quote quantums, determined by the oracle price) of
465    /// all positions liquidated for this subaccount.
466    #[prost(uint64, tag = "2")]
467    pub notional_liquidated: u64,
468    /// The amount of funds that the insurance fund has lost
469    /// covering this subaccount.
470    #[prost(uint64, tag = "3")]
471    pub quantums_insurance_lost: u64,
472}
473impl ::prost::Name for SubaccountLiquidationInfo {
474    const NAME: &'static str = "SubaccountLiquidationInfo";
475    const PACKAGE: &'static str = "dydxprotocol.clob";
476    fn full_name() -> ::prost::alloc::string::String {
477        "dydxprotocol.clob.SubaccountLiquidationInfo".into()
478    }
479    fn type_url() -> ::prost::alloc::string::String {
480        "/dydxprotocol.clob.SubaccountLiquidationInfo".into()
481    }
482}
483/// SubaccountOpenPositionInfo holds information about open positions for a
484/// perpetual.
485#[derive(Clone, PartialEq, ::prost::Message)]
486pub struct SubaccountOpenPositionInfo {
487    /// The id of the perpetual.
488    #[prost(uint32, tag = "1")]
489    pub perpetual_id: u32,
490    /// The ids of the subaccounts with long positions.
491    #[prost(message, repeated, tag = "2")]
492    pub subaccounts_with_long_position: ::prost::alloc::vec::Vec<
493        super::subaccounts::SubaccountId,
494    >,
495    /// The ids of the subaccounts with short positions.
496    #[prost(message, repeated, tag = "3")]
497    pub subaccounts_with_short_position: ::prost::alloc::vec::Vec<
498        super::subaccounts::SubaccountId,
499    >,
500}
501impl ::prost::Name for SubaccountOpenPositionInfo {
502    const NAME: &'static str = "SubaccountOpenPositionInfo";
503    const PACKAGE: &'static str = "dydxprotocol.clob";
504    fn full_name() -> ::prost::alloc::string::String {
505        "dydxprotocol.clob.SubaccountOpenPositionInfo".into()
506    }
507    fn type_url() -> ::prost::alloc::string::String {
508        "/dydxprotocol.clob.SubaccountOpenPositionInfo".into()
509    }
510}
511/// OrderId refers to a single order belonging to a Subaccount.
512#[derive(Clone, PartialEq, ::prost::Message)]
513pub struct OrderId {
514    /// The subaccount ID that opened this order.
515    /// Note that this field has `gogoproto.nullable = false` so that it is
516    /// generated as a value instead of a pointer. This is because the `OrderId`
517    /// proto is used as a key within maps, and map comparisons will compare
518    /// pointers for equality (when the desired behavior is to compare the values).
519    #[prost(message, optional, tag = "1")]
520    pub subaccount_id: ::core::option::Option<super::subaccounts::SubaccountId>,
521    /// The client ID of this order, unique with respect to the specific
522    /// sub account (I.E., the same subaccount can't have two orders with
523    /// the same ClientId).
524    #[prost(fixed32, tag = "2")]
525    pub client_id: u32,
526    /// order_flags represent order flags for the order. This field is invalid if
527    /// it's greater than 257. Each bit represents a different flag.
528    ///
529    /// The following are the valid orderId flags:
530    /// ShortTerm    = uint32(0)
531    /// Conditional  = uint32(32)
532    /// LongTerm     = uint32(64)
533    /// Twap         = uint32(128)
534    /// TwapSuborder = uint32(256) (for internal use only)
535    ///
536    /// If both bits are set or bits other than the 2nd and 3rd are set, the order
537    /// ID is invalid.
538    #[prost(uint32, tag = "3")]
539    pub order_flags: u32,
540    /// ID of the CLOB the order is created for.
541    #[prost(uint32, tag = "4")]
542    pub clob_pair_id: u32,
543}
544impl ::prost::Name for OrderId {
545    const NAME: &'static str = "OrderId";
546    const PACKAGE: &'static str = "dydxprotocol.clob";
547    fn full_name() -> ::prost::alloc::string::String {
548        "dydxprotocol.clob.OrderId".into()
549    }
550    fn type_url() -> ::prost::alloc::string::String {
551        "/dydxprotocol.clob.OrderId".into()
552    }
553}
554/// OrdersFilledDuringLatestBlock represents a list of `OrderIds` that were
555/// filled by any non-zero amount in the latest block.
556#[derive(Clone, PartialEq, ::prost::Message)]
557pub struct OrdersFilledDuringLatestBlock {
558    /// A list of unique order_ids that were filled by any non-zero amount in the
559    /// latest block.
560    #[prost(message, repeated, tag = "1")]
561    pub order_ids: ::prost::alloc::vec::Vec<OrderId>,
562}
563impl ::prost::Name for OrdersFilledDuringLatestBlock {
564    const NAME: &'static str = "OrdersFilledDuringLatestBlock";
565    const PACKAGE: &'static str = "dydxprotocol.clob";
566    fn full_name() -> ::prost::alloc::string::String {
567        "dydxprotocol.clob.OrdersFilledDuringLatestBlock".into()
568    }
569    fn type_url() -> ::prost::alloc::string::String {
570        "/dydxprotocol.clob.OrdersFilledDuringLatestBlock".into()
571    }
572}
573/// PotentiallyPrunableOrders represents a list of orders that may be prunable
574/// from state at a future block height.
575#[derive(Clone, PartialEq, ::prost::Message)]
576pub struct PotentiallyPrunableOrders {
577    /// A list of unique order_ids that may potentially be pruned from state at a
578    /// future block height.
579    #[prost(message, repeated, tag = "1")]
580    pub order_ids: ::prost::alloc::vec::Vec<OrderId>,
581}
582impl ::prost::Name for PotentiallyPrunableOrders {
583    const NAME: &'static str = "PotentiallyPrunableOrders";
584    const PACKAGE: &'static str = "dydxprotocol.clob";
585    fn full_name() -> ::prost::alloc::string::String {
586        "dydxprotocol.clob.PotentiallyPrunableOrders".into()
587    }
588    fn type_url() -> ::prost::alloc::string::String {
589        "/dydxprotocol.clob.PotentiallyPrunableOrders".into()
590    }
591}
592/// OrderFillState represents the fill amount of an order according to on-chain
593/// state. This proto includes both the current on-chain fill amount of the
594/// order, as well as the block at which this information can be pruned from
595/// state.
596#[derive(Clone, Copy, PartialEq, ::prost::Message)]
597pub struct OrderFillState {
598    /// The current fillAmount of the order according to on-chain state.
599    #[prost(uint64, tag = "1")]
600    pub fill_amount: u64,
601    /// The block height at which the fillAmount state for this order can be
602    /// pruned.
603    #[prost(uint32, tag = "2")]
604    pub prunable_block_height: u32,
605}
606impl ::prost::Name for OrderFillState {
607    const NAME: &'static str = "OrderFillState";
608    const PACKAGE: &'static str = "dydxprotocol.clob";
609    fn full_name() -> ::prost::alloc::string::String {
610        "dydxprotocol.clob.OrderFillState".into()
611    }
612    fn type_url() -> ::prost::alloc::string::String {
613        "/dydxprotocol.clob.OrderFillState".into()
614    }
615}
616/// StatefulOrderTimeSliceValue represents the type of the value of the
617/// `StatefulOrdersTimeSlice` in state. The `StatefulOrdersTimeSlice`
618/// in state consists of key/value pairs where the keys are UTF-8-encoded
619/// `RFC3339NANO` timestamp strings with right-padded zeroes and no
620/// time zone info, and the values are of type `StatefulOrderTimeSliceValue`.
621/// This `StatefulOrderTimeSliceValue` in state is used for managing stateful
622/// order expiration. Stateful order expirations can be for either long term
623/// or conditional orders.
624#[derive(Clone, PartialEq, ::prost::Message)]
625pub struct StatefulOrderTimeSliceValue {
626    /// A unique list of order_ids that expire at this timestamp, sorted in
627    /// ascending order by block height and transaction index of each stateful
628    /// order.
629    #[prost(message, repeated, tag = "1")]
630    pub order_ids: ::prost::alloc::vec::Vec<OrderId>,
631}
632impl ::prost::Name for StatefulOrderTimeSliceValue {
633    const NAME: &'static str = "StatefulOrderTimeSliceValue";
634    const PACKAGE: &'static str = "dydxprotocol.clob";
635    fn full_name() -> ::prost::alloc::string::String {
636        "dydxprotocol.clob.StatefulOrderTimeSliceValue".into()
637    }
638    fn type_url() -> ::prost::alloc::string::String {
639        "/dydxprotocol.clob.StatefulOrderTimeSliceValue".into()
640    }
641}
642/// LongTermOrderPlacement represents the placement of a stateful order in
643/// state. It stores the stateful order itself and the `BlockHeight` and
644/// `TransactionIndex` at which the order was placed.
645#[derive(Clone, PartialEq, ::prost::Message)]
646pub struct LongTermOrderPlacement {
647    #[prost(message, optional, tag = "1")]
648    pub order: ::core::option::Option<Order>,
649    /// The block height and transaction index at which the order was placed.
650    /// Used for ordering by time priority when the chain is restarted.
651    #[prost(message, optional, tag = "2")]
652    pub placement_index: ::core::option::Option<TransactionOrdering>,
653}
654impl ::prost::Name for LongTermOrderPlacement {
655    const NAME: &'static str = "LongTermOrderPlacement";
656    const PACKAGE: &'static str = "dydxprotocol.clob";
657    fn full_name() -> ::prost::alloc::string::String {
658        "dydxprotocol.clob.LongTermOrderPlacement".into()
659    }
660    fn type_url() -> ::prost::alloc::string::String {
661        "/dydxprotocol.clob.LongTermOrderPlacement".into()
662    }
663}
664/// TwapOrderPlacement represents the placement of a TWAP order in
665/// the TWAP Order State. It will store the original parent TWAP order as
666/// well as maintain the state of the remaining legs and quantums
667/// to be executed.
668#[derive(Clone, PartialEq, ::prost::Message)]
669pub struct TwapOrderPlacement {
670    #[prost(message, optional, tag = "1")]
671    pub order: ::core::option::Option<Order>,
672    /// The number of legs remaining to be executed.
673    #[prost(uint32, tag = "2")]
674    pub remaining_legs: u32,
675    /// The number of quantums remaining to be executed.
676    #[prost(uint64, tag = "3")]
677    pub remaining_quantums: u64,
678}
679impl ::prost::Name for TwapOrderPlacement {
680    const NAME: &'static str = "TwapOrderPlacement";
681    const PACKAGE: &'static str = "dydxprotocol.clob";
682    fn full_name() -> ::prost::alloc::string::String {
683        "dydxprotocol.clob.TwapOrderPlacement".into()
684    }
685    fn type_url() -> ::prost::alloc::string::String {
686        "/dydxprotocol.clob.TwapOrderPlacement".into()
687    }
688}
689/// ConditionalOrderPlacement represents the placement of a conditional order in
690/// state. It stores the stateful order itself, the `BlockHeight` and
691/// `TransactionIndex` at which the order was placed and triggered.
692#[derive(Clone, PartialEq, ::prost::Message)]
693pub struct ConditionalOrderPlacement {
694    #[prost(message, optional, tag = "1")]
695    pub order: ::core::option::Option<Order>,
696    /// The block height and transaction index at which the order was placed.
697    #[prost(message, optional, tag = "2")]
698    pub placement_index: ::core::option::Option<TransactionOrdering>,
699    /// The block height and transaction index at which the order was triggered.
700    /// Set to be nil if the transaction has not been triggered.
701    /// Used for ordering by time priority when the chain is restarted.
702    #[prost(message, optional, tag = "3")]
703    pub trigger_index: ::core::option::Option<TransactionOrdering>,
704}
705impl ::prost::Name for ConditionalOrderPlacement {
706    const NAME: &'static str = "ConditionalOrderPlacement";
707    const PACKAGE: &'static str = "dydxprotocol.clob";
708    fn full_name() -> ::prost::alloc::string::String {
709        "dydxprotocol.clob.ConditionalOrderPlacement".into()
710    }
711    fn type_url() -> ::prost::alloc::string::String {
712        "/dydxprotocol.clob.ConditionalOrderPlacement".into()
713    }
714}
715/// Order represents a single order belonging to a `Subaccount`
716/// for a particular `ClobPair`.
717#[derive(Clone, PartialEq, ::prost::Message)]
718pub struct Order {
719    /// The unique ID of this order. Meant to be unique across all orders.
720    #[prost(message, optional, tag = "1")]
721    pub order_id: ::core::option::Option<OrderId>,
722    #[prost(enumeration = "order::Side", tag = "2")]
723    pub side: i32,
724    /// The size of this order in base quantums. Must be a multiple of
725    /// `ClobPair.StepBaseQuantums` (where `ClobPair.Id = orderId.ClobPairId`).
726    #[prost(uint64, tag = "3")]
727    pub quantums: u64,
728    /// The price level that this order will be placed at on the orderbook,
729    /// in subticks. Must be a multiple of ClobPair.SubticksPerTick
730    /// (where `ClobPair.Id = orderId.ClobPairId`).
731    #[prost(uint64, tag = "4")]
732    pub subticks: u64,
733    /// The time in force of this order.
734    #[prost(enumeration = "order::TimeInForce", tag = "7")]
735    pub time_in_force: i32,
736    /// Enforces that the order can only reduce the size of an existing position.
737    /// If a ReduceOnly order would change the side of the existing position,
738    /// its size is reduced to that of the remaining size of the position.
739    /// If existing orders on the book with ReduceOnly
740    /// would already close the position, the least aggressive (out-of-the-money)
741    /// ReduceOnly orders are resized and canceled first.
742    #[prost(bool, tag = "8")]
743    pub reduce_only: bool,
744    /// Set of bit flags set arbitrarily by clients and ignored by the protocol.
745    /// Used by indexer to infer information about a placed order.
746    #[prost(uint32, tag = "9")]
747    pub client_metadata: u32,
748    #[prost(enumeration = "order::ConditionType", tag = "10")]
749    pub condition_type: i32,
750    /// conditional_order_trigger_subticks represents the price at which this order
751    /// will be triggered. If the condition_type is CONDITION_TYPE_UNSPECIFIED,
752    /// this value is enforced to be 0. If this value is nonzero, condition_type
753    /// cannot be CONDITION_TYPE_UNSPECIFIED. Value is in subticks.
754    /// Must be a multiple of ClobPair.SubticksPerTick (where `ClobPair.Id =
755    /// orderId.ClobPairId`).
756    #[prost(uint64, tag = "11")]
757    pub conditional_order_trigger_subticks: u64,
758    /// twap_parameters represent the configuration for a TWAP order. This must be
759    /// set for twap orders and will be ignored for all other order types.
760    #[prost(message, optional, tag = "12")]
761    pub twap_parameters: ::core::option::Option<TwapParameters>,
762    /// builder_code_parameters is the metadata for the
763    /// partner or builder of an order specifying the fees charged.
764    #[prost(message, optional, tag = "13")]
765    pub builder_code_parameters: ::core::option::Option<BuilderCodeParameters>,
766    /// order_router_address is the address of the order router that placed the
767    /// order.
768    #[prost(string, tag = "14")]
769    pub order_router_address: ::prost::alloc::string::String,
770    /// Information about when the order expires.
771    #[prost(oneof = "order::GoodTilOneof", tags = "5, 6")]
772    pub good_til_oneof: ::core::option::Option<order::GoodTilOneof>,
773}
774/// Nested message and enum types in `Order`.
775pub mod order {
776    /// Represents the side of the orderbook the order will be placed on.
777    /// Note that Side.SIDE_UNSPECIFIED is an invalid order and cannot be
778    /// placed on the orderbook.
779    #[derive(
780        Clone,
781        Copy,
782        Debug,
783        PartialEq,
784        Eq,
785        Hash,
786        PartialOrd,
787        Ord,
788        ::prost::Enumeration
789    )]
790    #[repr(i32)]
791    pub enum Side {
792        /// Default value. This value is invalid and unused.
793        Unspecified = 0,
794        /// SIDE_BUY is used to represent a BUY order.
795        Buy = 1,
796        /// SIDE_SELL is used to represent a SELL order.
797        Sell = 2,
798    }
799    impl Side {
800        /// String value of the enum field names used in the ProtoBuf definition.
801        ///
802        /// The values are not transformed in any way and thus are considered stable
803        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
804        pub fn as_str_name(&self) -> &'static str {
805            match self {
806                Self::Unspecified => "SIDE_UNSPECIFIED",
807                Self::Buy => "SIDE_BUY",
808                Self::Sell => "SIDE_SELL",
809            }
810        }
811        /// Creates an enum from field names used in the ProtoBuf definition.
812        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
813            match value {
814                "SIDE_UNSPECIFIED" => Some(Self::Unspecified),
815                "SIDE_BUY" => Some(Self::Buy),
816                "SIDE_SELL" => Some(Self::Sell),
817                _ => None,
818            }
819        }
820    }
821    /// TimeInForce indicates how long an order will remain active before it
822    /// is executed or expires.
823    #[derive(
824        Clone,
825        Copy,
826        Debug,
827        PartialEq,
828        Eq,
829        Hash,
830        PartialOrd,
831        Ord,
832        ::prost::Enumeration
833    )]
834    #[repr(i32)]
835    pub enum TimeInForce {
836        /// TIME_IN_FORCE_UNSPECIFIED represents the default behavior where an
837        /// order will first match with existing orders on the book, and any
838        /// remaining size will be added to the book as a maker order.
839        Unspecified = 0,
840        /// TIME_IN_FORCE_IOC enforces that an order only be matched with
841        /// maker orders on the book. If the order has remaining size after
842        /// matching with existing orders on the book, the remaining size
843        /// is not placed on the book.
844        Ioc = 1,
845        /// TIME_IN_FORCE_POST_ONLY enforces that an order only be placed
846        /// on the book as a maker order. Note this means that validators will cancel
847        /// any newly-placed post only orders that would cross with other maker
848        /// orders.
849        PostOnly = 2,
850        /// TIME_IN_FORCE_FILL_OR_KILL has been deprecated and will be removed in
851        /// future versions.
852        FillOrKill = 3,
853    }
854    impl TimeInForce {
855        /// String value of the enum field names used in the ProtoBuf definition.
856        ///
857        /// The values are not transformed in any way and thus are considered stable
858        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
859        pub fn as_str_name(&self) -> &'static str {
860            match self {
861                Self::Unspecified => "TIME_IN_FORCE_UNSPECIFIED",
862                Self::Ioc => "TIME_IN_FORCE_IOC",
863                Self::PostOnly => "TIME_IN_FORCE_POST_ONLY",
864                Self::FillOrKill => "TIME_IN_FORCE_FILL_OR_KILL",
865            }
866        }
867        /// Creates an enum from field names used in the ProtoBuf definition.
868        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
869            match value {
870                "TIME_IN_FORCE_UNSPECIFIED" => Some(Self::Unspecified),
871                "TIME_IN_FORCE_IOC" => Some(Self::Ioc),
872                "TIME_IN_FORCE_POST_ONLY" => Some(Self::PostOnly),
873                "TIME_IN_FORCE_FILL_OR_KILL" => Some(Self::FillOrKill),
874                _ => None,
875            }
876        }
877    }
878    #[derive(
879        Clone,
880        Copy,
881        Debug,
882        PartialEq,
883        Eq,
884        Hash,
885        PartialOrd,
886        Ord,
887        ::prost::Enumeration
888    )]
889    #[repr(i32)]
890    pub enum ConditionType {
891        /// CONDITION_TYPE_UNSPECIFIED represents the default behavior where an
892        /// order will be placed immediately on the orderbook.
893        Unspecified = 0,
894        /// CONDITION_TYPE_STOP_LOSS represents a stop order. A stop order will
895        /// trigger when the oracle price moves at or above the trigger price for
896        /// buys, and at or below the trigger price for sells.
897        StopLoss = 1,
898        /// CONDITION_TYPE_TAKE_PROFIT represents a take profit order. A take profit
899        /// order will trigger when the oracle price moves at or below the trigger
900        /// price for buys and at or above the trigger price for sells.
901        TakeProfit = 2,
902    }
903    impl ConditionType {
904        /// String value of the enum field names used in the ProtoBuf definition.
905        ///
906        /// The values are not transformed in any way and thus are considered stable
907        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
908        pub fn as_str_name(&self) -> &'static str {
909            match self {
910                Self::Unspecified => "CONDITION_TYPE_UNSPECIFIED",
911                Self::StopLoss => "CONDITION_TYPE_STOP_LOSS",
912                Self::TakeProfit => "CONDITION_TYPE_TAKE_PROFIT",
913            }
914        }
915        /// Creates an enum from field names used in the ProtoBuf definition.
916        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
917            match value {
918                "CONDITION_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
919                "CONDITION_TYPE_STOP_LOSS" => Some(Self::StopLoss),
920                "CONDITION_TYPE_TAKE_PROFIT" => Some(Self::TakeProfit),
921                _ => None,
922            }
923        }
924    }
925    /// Information about when the order expires.
926    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
927    pub enum GoodTilOneof {
928        /// The last block this order can be executed at (after which it will be
929        /// unfillable). Used only for Short-Term orders. If this value is non-zero
930        /// then the order is assumed to be a Short-Term order.
931        #[prost(uint32, tag = "5")]
932        GoodTilBlock(u32),
933        /// good_til_block_time represents the unix timestamp (in seconds) at which a
934        /// stateful order will be considered expired. The
935        /// good_til_block_time is always evaluated against the previous block's
936        /// `BlockTime` instead of the block in which the order is committed. If this
937        /// value is non-zero then the order is assumed to be a stateful or
938        /// conditional order.
939        #[prost(fixed32, tag = "6")]
940        GoodTilBlockTime(u32),
941    }
942}
943impl ::prost::Name for Order {
944    const NAME: &'static str = "Order";
945    const PACKAGE: &'static str = "dydxprotocol.clob";
946    fn full_name() -> ::prost::alloc::string::String {
947        "dydxprotocol.clob.Order".into()
948    }
949    fn type_url() -> ::prost::alloc::string::String {
950        "/dydxprotocol.clob.Order".into()
951    }
952}
953/// TwapParameters represents the necessary configuration for a TWAP order.
954#[derive(Clone, Copy, PartialEq, ::prost::Message)]
955pub struct TwapParameters {
956    /// Duration of the TWAP order execution in seconds. Must be in the range
957    /// \[300 (5 minutes), 86400 (24 hours)\].
958    #[prost(uint32, tag = "1")]
959    pub duration: u32,
960    /// Interval in seconds for each suborder to execute. Must be a
961    /// whole number, a factor of the duration, and in the range
962    /// \[30 (30 seconds), 3600 (1 hour)\].
963    #[prost(uint32, tag = "2")]
964    pub interval: u32,
965    /// Price tolerance in ppm for each suborder. This will be applied to
966    /// the oracle price each time a suborder is triggered. Must be
967    /// be in the range [0, 1_000_000).
968    #[prost(uint32, tag = "3")]
969    pub price_tolerance: u32,
970}
971impl ::prost::Name for TwapParameters {
972    const NAME: &'static str = "TwapParameters";
973    const PACKAGE: &'static str = "dydxprotocol.clob";
974    fn full_name() -> ::prost::alloc::string::String {
975        "dydxprotocol.clob.TwapParameters".into()
976    }
977    fn type_url() -> ::prost::alloc::string::String {
978        "/dydxprotocol.clob.TwapParameters".into()
979    }
980}
981/// BuilderCodeParameters represents the metadata for the partner or builder of
982/// an order. This allows them to specify a fee for providing there service which
983/// will be paid out in the event of an order fill.
984#[derive(Clone, PartialEq, ::prost::Message)]
985pub struct BuilderCodeParameters {
986    /// The address of the builder to which the fee will be paid.
987    #[prost(string, tag = "1")]
988    pub builder_address: ::prost::alloc::string::String,
989    /// The fee enforced on the order in ppm.
990    #[prost(uint32, tag = "2")]
991    pub fee_ppm: u32,
992}
993impl ::prost::Name for BuilderCodeParameters {
994    const NAME: &'static str = "BuilderCodeParameters";
995    const PACKAGE: &'static str = "dydxprotocol.clob";
996    fn full_name() -> ::prost::alloc::string::String {
997        "dydxprotocol.clob.BuilderCodeParameters".into()
998    }
999    fn type_url() -> ::prost::alloc::string::String {
1000        "/dydxprotocol.clob.BuilderCodeParameters".into()
1001    }
1002}
1003/// TransactionOrdering represents a unique location in the block where a
1004/// transaction was placed. This proto includes both block height and the
1005/// transaction index that the specific transaction was placed. This information
1006/// is used for ordering by time priority when the chain is restarted.
1007#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1008pub struct TransactionOrdering {
1009    /// Block height in which the transaction was placed.
1010    #[prost(uint32, tag = "1")]
1011    pub block_height: u32,
1012    /// Within the block, the unique transaction index.
1013    #[prost(uint32, tag = "2")]
1014    pub transaction_index: u32,
1015}
1016impl ::prost::Name for TransactionOrdering {
1017    const NAME: &'static str = "TransactionOrdering";
1018    const PACKAGE: &'static str = "dydxprotocol.clob";
1019    fn full_name() -> ::prost::alloc::string::String {
1020        "dydxprotocol.clob.TransactionOrdering".into()
1021    }
1022    fn type_url() -> ::prost::alloc::string::String {
1023        "/dydxprotocol.clob.TransactionOrdering".into()
1024    }
1025}
1026/// StreamLiquidationOrder represents an protocol-generated IOC liquidation
1027/// order. Used in full node streaming.
1028#[derive(Clone, PartialEq, ::prost::Message)]
1029pub struct StreamLiquidationOrder {
1030    /// Information about this liquidation order.
1031    #[prost(message, optional, tag = "1")]
1032    pub liquidation_info: ::core::option::Option<PerpetualLiquidationInfo>,
1033    /// CLOB pair ID of the CLOB pair the liquidation order will be matched
1034    /// against.
1035    #[prost(uint32, tag = "2")]
1036    pub clob_pair_id: u32,
1037    /// True if this is a buy order liquidating a short position, false if vice
1038    /// versa.
1039    #[prost(bool, tag = "3")]
1040    pub is_buy: bool,
1041    /// The number of base quantums for this liquidation order.
1042    #[prost(uint64, tag = "4")]
1043    pub quantums: u64,
1044    /// The subticks this liquidation order will be submitted at.
1045    #[prost(uint64, tag = "5")]
1046    pub subticks: u64,
1047}
1048impl ::prost::Name for StreamLiquidationOrder {
1049    const NAME: &'static str = "StreamLiquidationOrder";
1050    const PACKAGE: &'static str = "dydxprotocol.clob";
1051    fn full_name() -> ::prost::alloc::string::String {
1052        "dydxprotocol.clob.StreamLiquidationOrder".into()
1053    }
1054    fn type_url() -> ::prost::alloc::string::String {
1055        "/dydxprotocol.clob.StreamLiquidationOrder".into()
1056    }
1057}
1058/// ClobMatch represents an operations queue entry around all different types
1059/// of matches, specifically regular matches, liquidation matches, and
1060/// deleveraging matches.
1061#[derive(Clone, PartialEq, ::prost::Message)]
1062pub struct ClobMatch {
1063    /// The match type that this message includes.
1064    #[prost(oneof = "clob_match::Match", tags = "1, 2, 3")]
1065    pub r#match: ::core::option::Option<clob_match::Match>,
1066}
1067/// Nested message and enum types in `ClobMatch`.
1068pub mod clob_match {
1069    /// The match type that this message includes.
1070    #[derive(Clone, PartialEq, ::prost::Oneof)]
1071    pub enum Match {
1072        #[prost(message, tag = "1")]
1073        MatchOrders(super::MatchOrders),
1074        #[prost(message, tag = "2")]
1075        MatchPerpetualLiquidation(super::MatchPerpetualLiquidation),
1076        #[prost(message, tag = "3")]
1077        MatchPerpetualDeleveraging(super::MatchPerpetualDeleveraging),
1078    }
1079}
1080impl ::prost::Name for ClobMatch {
1081    const NAME: &'static str = "ClobMatch";
1082    const PACKAGE: &'static str = "dydxprotocol.clob";
1083    fn full_name() -> ::prost::alloc::string::String {
1084        "dydxprotocol.clob.ClobMatch".into()
1085    }
1086    fn type_url() -> ::prost::alloc::string::String {
1087        "/dydxprotocol.clob.ClobMatch".into()
1088    }
1089}
1090/// MakerFill represents the filled amount of a matched maker order.
1091#[derive(Clone, PartialEq, ::prost::Message)]
1092pub struct MakerFill {
1093    /// The filled amount of the matched maker order, in base quantums.
1094    /// TODO(CLOB-571): update to use SerializableInt.
1095    #[prost(uint64, tag = "1")]
1096    pub fill_amount: u64,
1097    /// The `OrderId` of the matched maker order.
1098    #[prost(message, optional, tag = "2")]
1099    pub maker_order_id: ::core::option::Option<OrderId>,
1100}
1101impl ::prost::Name for MakerFill {
1102    const NAME: &'static str = "MakerFill";
1103    const PACKAGE: &'static str = "dydxprotocol.clob";
1104    fn full_name() -> ::prost::alloc::string::String {
1105        "dydxprotocol.clob.MakerFill".into()
1106    }
1107    fn type_url() -> ::prost::alloc::string::String {
1108        "/dydxprotocol.clob.MakerFill".into()
1109    }
1110}
1111/// MatchOrders is an injected message used for matching orders.
1112#[derive(Clone, PartialEq, ::prost::Message)]
1113pub struct MatchOrders {
1114    /// The `OrderId` of the taker order.
1115    #[prost(message, optional, tag = "1")]
1116    pub taker_order_id: ::core::option::Option<OrderId>,
1117    /// An ordered list of fills created by this taker order.
1118    #[prost(message, repeated, tag = "2")]
1119    pub fills: ::prost::alloc::vec::Vec<MakerFill>,
1120}
1121impl ::prost::Name for MatchOrders {
1122    const NAME: &'static str = "MatchOrders";
1123    const PACKAGE: &'static str = "dydxprotocol.clob";
1124    fn full_name() -> ::prost::alloc::string::String {
1125        "dydxprotocol.clob.MatchOrders".into()
1126    }
1127    fn type_url() -> ::prost::alloc::string::String {
1128        "/dydxprotocol.clob.MatchOrders".into()
1129    }
1130}
1131/// MatchPerpetualLiquidation is an injected message used for liquidating a
1132/// subaccount.
1133#[derive(Clone, PartialEq, ::prost::Message)]
1134pub struct MatchPerpetualLiquidation {
1135    /// ID of the subaccount that was liquidated.
1136    #[prost(message, optional, tag = "1")]
1137    pub liquidated: ::core::option::Option<super::subaccounts::SubaccountId>,
1138    /// The ID of the clob pair involved in the liquidation.
1139    #[prost(uint32, tag = "2")]
1140    pub clob_pair_id: u32,
1141    /// The ID of the perpetual involved in the liquidation.
1142    #[prost(uint32, tag = "3")]
1143    pub perpetual_id: u32,
1144    /// The total size of the liquidation order including any unfilled size.
1145    #[prost(uint64, tag = "4")]
1146    pub total_size: u64,
1147    /// `true` if liquidating a short position, `false` otherwise.
1148    #[prost(bool, tag = "5")]
1149    pub is_buy: bool,
1150    /// An ordered list of fills created by this liquidation.
1151    #[prost(message, repeated, tag = "6")]
1152    pub fills: ::prost::alloc::vec::Vec<MakerFill>,
1153}
1154impl ::prost::Name for MatchPerpetualLiquidation {
1155    const NAME: &'static str = "MatchPerpetualLiquidation";
1156    const PACKAGE: &'static str = "dydxprotocol.clob";
1157    fn full_name() -> ::prost::alloc::string::String {
1158        "dydxprotocol.clob.MatchPerpetualLiquidation".into()
1159    }
1160    fn type_url() -> ::prost::alloc::string::String {
1161        "/dydxprotocol.clob.MatchPerpetualLiquidation".into()
1162    }
1163}
1164/// MatchPerpetualDeleveraging is an injected message used for deleveraging a
1165/// subaccount.
1166#[derive(Clone, PartialEq, ::prost::Message)]
1167pub struct MatchPerpetualDeleveraging {
1168    /// ID of the subaccount that was liquidated.
1169    #[prost(message, optional, tag = "1")]
1170    pub liquidated: ::core::option::Option<super::subaccounts::SubaccountId>,
1171    /// The ID of the perpetual that was liquidated.
1172    #[prost(uint32, tag = "2")]
1173    pub perpetual_id: u32,
1174    /// An ordered list of fills created by this liquidation.
1175    #[prost(message, repeated, tag = "3")]
1176    pub fills: ::prost::alloc::vec::Vec<match_perpetual_deleveraging::Fill>,
1177    /// Flag denoting whether the deleveraging operation was for the purpose
1178    /// of final settlement. Final settlement matches are at the oracle price,
1179    /// whereas deleveraging happens at the bankruptcy price of the deleveraged
1180    /// subaccount.
1181    #[prost(bool, tag = "4")]
1182    pub is_final_settlement: bool,
1183}
1184/// Nested message and enum types in `MatchPerpetualDeleveraging`.
1185pub mod match_perpetual_deleveraging {
1186    /// Fill represents a fill between the liquidated and offsetting subaccount.
1187    #[derive(Clone, PartialEq, ::prost::Message)]
1188    pub struct Fill {
1189        /// ID of the subaccount that was used to offset the liquidated subaccount's
1190        /// position.
1191        #[prost(message, optional, tag = "1")]
1192        pub offsetting_subaccount_id: ::core::option::Option<
1193            super::super::subaccounts::SubaccountId,
1194        >,
1195        /// The amount filled between the liquidated and offsetting position, in
1196        /// base quantums.
1197        /// TODO(CLOB-571): update to use SerializableInt.
1198        #[prost(uint64, tag = "2")]
1199        pub fill_amount: u64,
1200    }
1201    impl ::prost::Name for Fill {
1202        const NAME: &'static str = "Fill";
1203        const PACKAGE: &'static str = "dydxprotocol.clob";
1204        fn full_name() -> ::prost::alloc::string::String {
1205            "dydxprotocol.clob.MatchPerpetualDeleveraging.Fill".into()
1206        }
1207        fn type_url() -> ::prost::alloc::string::String {
1208            "/dydxprotocol.clob.MatchPerpetualDeleveraging.Fill".into()
1209        }
1210    }
1211}
1212impl ::prost::Name for MatchPerpetualDeleveraging {
1213    const NAME: &'static str = "MatchPerpetualDeleveraging";
1214    const PACKAGE: &'static str = "dydxprotocol.clob";
1215    fn full_name() -> ::prost::alloc::string::String {
1216        "dydxprotocol.clob.MatchPerpetualDeleveraging".into()
1217    }
1218    fn type_url() -> ::prost::alloc::string::String {
1219        "/dydxprotocol.clob.MatchPerpetualDeleveraging".into()
1220    }
1221}
1222/// MEVMatch represents all necessary data to calculate MEV for a regular match.
1223#[derive(Clone, PartialEq, ::prost::Message)]
1224pub struct MevMatch {
1225    #[prost(message, optional, tag = "1")]
1226    pub taker_order_subaccount_id: ::core::option::Option<
1227        super::subaccounts::SubaccountId,
1228    >,
1229    #[prost(int32, tag = "2")]
1230    pub taker_fee_ppm: i32,
1231    #[prost(message, optional, tag = "3")]
1232    pub maker_order_subaccount_id: ::core::option::Option<
1233        super::subaccounts::SubaccountId,
1234    >,
1235    #[prost(uint64, tag = "4")]
1236    pub maker_order_subticks: u64,
1237    #[prost(bool, tag = "5")]
1238    pub maker_order_is_buy: bool,
1239    #[prost(int32, tag = "6")]
1240    pub maker_fee_ppm: i32,
1241    #[prost(uint32, tag = "7")]
1242    pub clob_pair_id: u32,
1243    #[prost(uint64, tag = "8")]
1244    pub fill_amount: u64,
1245}
1246impl ::prost::Name for MevMatch {
1247    const NAME: &'static str = "MEVMatch";
1248    const PACKAGE: &'static str = "dydxprotocol.clob";
1249    fn full_name() -> ::prost::alloc::string::String {
1250        "dydxprotocol.clob.MEVMatch".into()
1251    }
1252    fn type_url() -> ::prost::alloc::string::String {
1253        "/dydxprotocol.clob.MEVMatch".into()
1254    }
1255}
1256/// MEVLiquidationMatch represents all necessary data to calculate MEV for a
1257/// liquidation.
1258#[derive(Clone, PartialEq, ::prost::Message)]
1259pub struct MevLiquidationMatch {
1260    #[prost(message, optional, tag = "1")]
1261    pub liquidated_subaccount_id: ::core::option::Option<
1262        super::subaccounts::SubaccountId,
1263    >,
1264    #[prost(int64, tag = "2")]
1265    pub insurance_fund_delta_quote_quantums: i64,
1266    #[prost(message, optional, tag = "3")]
1267    pub maker_order_subaccount_id: ::core::option::Option<
1268        super::subaccounts::SubaccountId,
1269    >,
1270    #[prost(uint64, tag = "4")]
1271    pub maker_order_subticks: u64,
1272    #[prost(bool, tag = "5")]
1273    pub maker_order_is_buy: bool,
1274    #[prost(int32, tag = "6")]
1275    pub maker_fee_ppm: i32,
1276    #[prost(uint32, tag = "7")]
1277    pub clob_pair_id: u32,
1278    #[prost(uint64, tag = "8")]
1279    pub fill_amount: u64,
1280}
1281impl ::prost::Name for MevLiquidationMatch {
1282    const NAME: &'static str = "MEVLiquidationMatch";
1283    const PACKAGE: &'static str = "dydxprotocol.clob";
1284    fn full_name() -> ::prost::alloc::string::String {
1285        "dydxprotocol.clob.MEVLiquidationMatch".into()
1286    }
1287    fn type_url() -> ::prost::alloc::string::String {
1288        "/dydxprotocol.clob.MEVLiquidationMatch".into()
1289    }
1290}
1291/// ClobMidPrice contains the mid price of a CLOB pair, represented by it's ID.
1292#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1293pub struct ClobMidPrice {
1294    #[prost(message, optional, tag = "1")]
1295    pub clob_pair: ::core::option::Option<ClobPair>,
1296    #[prost(uint64, tag = "2")]
1297    pub subticks: u64,
1298}
1299impl ::prost::Name for ClobMidPrice {
1300    const NAME: &'static str = "ClobMidPrice";
1301    const PACKAGE: &'static str = "dydxprotocol.clob";
1302    fn full_name() -> ::prost::alloc::string::String {
1303        "dydxprotocol.clob.ClobMidPrice".into()
1304    }
1305    fn type_url() -> ::prost::alloc::string::String {
1306        "/dydxprotocol.clob.ClobMidPrice".into()
1307    }
1308}
1309/// ValidatorMevMatches contains all matches from the validator's local
1310/// operations queue.
1311#[derive(Clone, PartialEq, ::prost::Message)]
1312pub struct ValidatorMevMatches {
1313    #[prost(message, repeated, tag = "1")]
1314    pub matches: ::prost::alloc::vec::Vec<MevMatch>,
1315    #[prost(message, repeated, tag = "2")]
1316    pub liquidation_matches: ::prost::alloc::vec::Vec<MevLiquidationMatch>,
1317}
1318impl ::prost::Name for ValidatorMevMatches {
1319    const NAME: &'static str = "ValidatorMevMatches";
1320    const PACKAGE: &'static str = "dydxprotocol.clob";
1321    fn full_name() -> ::prost::alloc::string::String {
1322        "dydxprotocol.clob.ValidatorMevMatches".into()
1323    }
1324    fn type_url() -> ::prost::alloc::string::String {
1325        "/dydxprotocol.clob.ValidatorMevMatches".into()
1326    }
1327}
1328/// MevNodeToNodeMetrics is a data structure for encapsulating all MEV node <>
1329/// node metrics.
1330#[derive(Clone, PartialEq, ::prost::Message)]
1331pub struct MevNodeToNodeMetrics {
1332    #[prost(message, optional, tag = "1")]
1333    pub validator_mev_matches: ::core::option::Option<ValidatorMevMatches>,
1334    #[prost(message, repeated, tag = "2")]
1335    pub clob_mid_prices: ::prost::alloc::vec::Vec<ClobMidPrice>,
1336    #[prost(message, optional, tag = "3")]
1337    pub bp_mev_matches: ::core::option::Option<ValidatorMevMatches>,
1338    #[prost(uint64, tag = "4")]
1339    pub proposal_receive_time: u64,
1340}
1341impl ::prost::Name for MevNodeToNodeMetrics {
1342    const NAME: &'static str = "MevNodeToNodeMetrics";
1343    const PACKAGE: &'static str = "dydxprotocol.clob";
1344    fn full_name() -> ::prost::alloc::string::String {
1345        "dydxprotocol.clob.MevNodeToNodeMetrics".into()
1346    }
1347    fn type_url() -> ::prost::alloc::string::String {
1348        "/dydxprotocol.clob.MevNodeToNodeMetrics".into()
1349    }
1350}
1351/// OrderRemoval is a request type used for forced removal of stateful orders.
1352#[derive(Clone, PartialEq, ::prost::Message)]
1353pub struct OrderRemoval {
1354    #[prost(message, optional, tag = "1")]
1355    pub order_id: ::core::option::Option<OrderId>,
1356    #[prost(enumeration = "order_removal::RemovalReason", tag = "2")]
1357    pub removal_reason: i32,
1358}
1359/// Nested message and enum types in `OrderRemoval`.
1360pub mod order_removal {
1361    #[derive(
1362        Clone,
1363        Copy,
1364        Debug,
1365        PartialEq,
1366        Eq,
1367        Hash,
1368        PartialOrd,
1369        Ord,
1370        ::prost::Enumeration
1371    )]
1372    #[repr(i32)]
1373    pub enum RemovalReason {
1374        /// REMOVAL_REASON_UNSPECIFIED represents an unspecified removal reason. This
1375        /// removal reason is used as a catchall and should never appear on an
1376        /// OrderRemoval in the operations queue.
1377        Unspecified = 0,
1378        /// REMOVAL_REASON_UNDERCOLLATERALIZED represents a removal of an order which
1379        /// if filled in isolation with respect to the current state of the
1380        /// subaccount would leave the subaccount undercollateralized.
1381        Undercollateralized = 1,
1382        /// REMOVAL_REASON_INVALID_REDUCE_ONLY represents a removal of a reduce-only
1383        /// order which if filled in isolation with respect to the current state of
1384        /// the subaccount would cause the subaccount's existing position to increase
1385        /// or change sides.
1386        InvalidReduceOnly = 2,
1387        /// REMOVAL_REASON_POST_ONLY_WOULD_CROSS_MAKER_ORDER represents a removal of
1388        /// a stateful post-only order that was deemed invalid because it crossed
1389        /// maker orders on the book of the proposer.
1390        PostOnlyWouldCrossMakerOrder = 3,
1391        /// REMOVAL_REASON_INVALID_SELF_TRADE represents a removal of a stateful
1392        /// order that was deemed invalid because it constituted a self trade on the
1393        /// proposers orderbook.
1394        InvalidSelfTrade = 4,
1395        /// REMOVAL_REASON_CONDITIONAL_FOK_COULD_NOT_BE_FULLY_FILLED represents a
1396        /// removal of a conditional FOK order that was deemed invalid because it
1397        /// could not be completely filled. Conditional FOK orders should always be
1398        /// fully-filled or removed in the block after they are triggered.
1399        ConditionalFokCouldNotBeFullyFilled = 5,
1400        /// REMOVAL_REASON_CONDITIONAL_IOC_WOULD_REST_ON_BOOK represents a removal
1401        /// of a conditional IOC order.
1402        /// Conditional IOC orders should always have their remaining size removed
1403        /// in the block after they are triggered.
1404        ConditionalIocWouldRestOnBook = 6,
1405        /// REMOVAL_REASON_FULLY_FILLED represents a removal of an order that
1406        /// was fully filled and should therefore be removed from state.
1407        FullyFilled = 7,
1408        /// REMOVAL_REASON_FULLY_FILLED represents a removal of an order that
1409        ///   would lead to the subaccount violating isolated subaccount constraints.
1410        ViolatesIsolatedSubaccountConstraints = 8,
1411        /// REMOVAL_REASON_PERMISSIONED_KEY_EXPIRED represents a removal of an order
1412        /// that was placed using an expired permissioned key.
1413        PermissionedKeyExpired = 9,
1414    }
1415    impl RemovalReason {
1416        /// String value of the enum field names used in the ProtoBuf definition.
1417        ///
1418        /// The values are not transformed in any way and thus are considered stable
1419        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1420        pub fn as_str_name(&self) -> &'static str {
1421            match self {
1422                Self::Unspecified => "REMOVAL_REASON_UNSPECIFIED",
1423                Self::Undercollateralized => "REMOVAL_REASON_UNDERCOLLATERALIZED",
1424                Self::InvalidReduceOnly => "REMOVAL_REASON_INVALID_REDUCE_ONLY",
1425                Self::PostOnlyWouldCrossMakerOrder => {
1426                    "REMOVAL_REASON_POST_ONLY_WOULD_CROSS_MAKER_ORDER"
1427                }
1428                Self::InvalidSelfTrade => "REMOVAL_REASON_INVALID_SELF_TRADE",
1429                Self::ConditionalFokCouldNotBeFullyFilled => {
1430                    "REMOVAL_REASON_CONDITIONAL_FOK_COULD_NOT_BE_FULLY_FILLED"
1431                }
1432                Self::ConditionalIocWouldRestOnBook => {
1433                    "REMOVAL_REASON_CONDITIONAL_IOC_WOULD_REST_ON_BOOK"
1434                }
1435                Self::FullyFilled => "REMOVAL_REASON_FULLY_FILLED",
1436                Self::ViolatesIsolatedSubaccountConstraints => {
1437                    "REMOVAL_REASON_VIOLATES_ISOLATED_SUBACCOUNT_CONSTRAINTS"
1438                }
1439                Self::PermissionedKeyExpired => "REMOVAL_REASON_PERMISSIONED_KEY_EXPIRED",
1440            }
1441        }
1442        /// Creates an enum from field names used in the ProtoBuf definition.
1443        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1444            match value {
1445                "REMOVAL_REASON_UNSPECIFIED" => Some(Self::Unspecified),
1446                "REMOVAL_REASON_UNDERCOLLATERALIZED" => Some(Self::Undercollateralized),
1447                "REMOVAL_REASON_INVALID_REDUCE_ONLY" => Some(Self::InvalidReduceOnly),
1448                "REMOVAL_REASON_POST_ONLY_WOULD_CROSS_MAKER_ORDER" => {
1449                    Some(Self::PostOnlyWouldCrossMakerOrder)
1450                }
1451                "REMOVAL_REASON_INVALID_SELF_TRADE" => Some(Self::InvalidSelfTrade),
1452                "REMOVAL_REASON_CONDITIONAL_FOK_COULD_NOT_BE_FULLY_FILLED" => {
1453                    Some(Self::ConditionalFokCouldNotBeFullyFilled)
1454                }
1455                "REMOVAL_REASON_CONDITIONAL_IOC_WOULD_REST_ON_BOOK" => {
1456                    Some(Self::ConditionalIocWouldRestOnBook)
1457                }
1458                "REMOVAL_REASON_FULLY_FILLED" => Some(Self::FullyFilled),
1459                "REMOVAL_REASON_VIOLATES_ISOLATED_SUBACCOUNT_CONSTRAINTS" => {
1460                    Some(Self::ViolatesIsolatedSubaccountConstraints)
1461                }
1462                "REMOVAL_REASON_PERMISSIONED_KEY_EXPIRED" => {
1463                    Some(Self::PermissionedKeyExpired)
1464                }
1465                _ => None,
1466            }
1467        }
1468    }
1469}
1470impl ::prost::Name for OrderRemoval {
1471    const NAME: &'static str = "OrderRemoval";
1472    const PACKAGE: &'static str = "dydxprotocol.clob";
1473    fn full_name() -> ::prost::alloc::string::String {
1474        "dydxprotocol.clob.OrderRemoval".into()
1475    }
1476    fn type_url() -> ::prost::alloc::string::String {
1477        "/dydxprotocol.clob.OrderRemoval".into()
1478    }
1479}
1480/// MsgCreateClobPair is a message used by x/gov for creating a new clob pair.
1481#[derive(Clone, PartialEq, ::prost::Message)]
1482pub struct MsgCreateClobPair {
1483    /// The address that controls the module.
1484    #[prost(string, tag = "1")]
1485    pub authority: ::prost::alloc::string::String,
1486    /// `clob_pair` defines parameters for the new clob pair.
1487    #[prost(message, optional, tag = "2")]
1488    pub clob_pair: ::core::option::Option<ClobPair>,
1489}
1490impl ::prost::Name for MsgCreateClobPair {
1491    const NAME: &'static str = "MsgCreateClobPair";
1492    const PACKAGE: &'static str = "dydxprotocol.clob";
1493    fn full_name() -> ::prost::alloc::string::String {
1494        "dydxprotocol.clob.MsgCreateClobPair".into()
1495    }
1496    fn type_url() -> ::prost::alloc::string::String {
1497        "/dydxprotocol.clob.MsgCreateClobPair".into()
1498    }
1499}
1500/// MsgCreateClobPairResponse defines the CreateClobPair response type.
1501#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1502pub struct MsgCreateClobPairResponse {}
1503impl ::prost::Name for MsgCreateClobPairResponse {
1504    const NAME: &'static str = "MsgCreateClobPairResponse";
1505    const PACKAGE: &'static str = "dydxprotocol.clob";
1506    fn full_name() -> ::prost::alloc::string::String {
1507        "dydxprotocol.clob.MsgCreateClobPairResponse".into()
1508    }
1509    fn type_url() -> ::prost::alloc::string::String {
1510        "/dydxprotocol.clob.MsgCreateClobPairResponse".into()
1511    }
1512}
1513/// MsgProposedOperations is a message injected by block proposers to
1514/// specify the operations that occurred in a block.
1515#[derive(Clone, PartialEq, ::prost::Message)]
1516pub struct MsgProposedOperations {
1517    /// The list of operations proposed by the block proposer.
1518    #[prost(message, repeated, tag = "1")]
1519    pub operations_queue: ::prost::alloc::vec::Vec<OperationRaw>,
1520}
1521impl ::prost::Name for MsgProposedOperations {
1522    const NAME: &'static str = "MsgProposedOperations";
1523    const PACKAGE: &'static str = "dydxprotocol.clob";
1524    fn full_name() -> ::prost::alloc::string::String {
1525        "dydxprotocol.clob.MsgProposedOperations".into()
1526    }
1527    fn type_url() -> ::prost::alloc::string::String {
1528        "/dydxprotocol.clob.MsgProposedOperations".into()
1529    }
1530}
1531/// MsgProposedOperationsResponse is the response type of the message injected
1532/// by block proposers to specify the operations that occurred in a block.
1533#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1534pub struct MsgProposedOperationsResponse {}
1535impl ::prost::Name for MsgProposedOperationsResponse {
1536    const NAME: &'static str = "MsgProposedOperationsResponse";
1537    const PACKAGE: &'static str = "dydxprotocol.clob";
1538    fn full_name() -> ::prost::alloc::string::String {
1539        "dydxprotocol.clob.MsgProposedOperationsResponse".into()
1540    }
1541    fn type_url() -> ::prost::alloc::string::String {
1542        "/dydxprotocol.clob.MsgProposedOperationsResponse".into()
1543    }
1544}
1545/// MsgPlaceOrder is a request type used for placing orders.
1546#[derive(Clone, PartialEq, ::prost::Message)]
1547pub struct MsgPlaceOrder {
1548    #[prost(message, optional, tag = "1")]
1549    pub order: ::core::option::Option<Order>,
1550}
1551impl ::prost::Name for MsgPlaceOrder {
1552    const NAME: &'static str = "MsgPlaceOrder";
1553    const PACKAGE: &'static str = "dydxprotocol.clob";
1554    fn full_name() -> ::prost::alloc::string::String {
1555        "dydxprotocol.clob.MsgPlaceOrder".into()
1556    }
1557    fn type_url() -> ::prost::alloc::string::String {
1558        "/dydxprotocol.clob.MsgPlaceOrder".into()
1559    }
1560}
1561/// MsgPlaceOrderResponse is a response type used for placing orders.
1562#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1563pub struct MsgPlaceOrderResponse {}
1564impl ::prost::Name for MsgPlaceOrderResponse {
1565    const NAME: &'static str = "MsgPlaceOrderResponse";
1566    const PACKAGE: &'static str = "dydxprotocol.clob";
1567    fn full_name() -> ::prost::alloc::string::String {
1568        "dydxprotocol.clob.MsgPlaceOrderResponse".into()
1569    }
1570    fn type_url() -> ::prost::alloc::string::String {
1571        "/dydxprotocol.clob.MsgPlaceOrderResponse".into()
1572    }
1573}
1574/// MsgCancelOrder is a request type used for canceling orders.
1575#[derive(Clone, PartialEq, ::prost::Message)]
1576pub struct MsgCancelOrder {
1577    #[prost(message, optional, tag = "1")]
1578    pub order_id: ::core::option::Option<OrderId>,
1579    /// Information about when the order cancellation expires.
1580    #[prost(oneof = "msg_cancel_order::GoodTilOneof", tags = "2, 3")]
1581    pub good_til_oneof: ::core::option::Option<msg_cancel_order::GoodTilOneof>,
1582}
1583/// Nested message and enum types in `MsgCancelOrder`.
1584pub mod msg_cancel_order {
1585    /// Information about when the order cancellation expires.
1586    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
1587    pub enum GoodTilOneof {
1588        /// The last block this order cancellation can be executed at.
1589        /// Used only for Short-Term orders and must be zero for stateful orders.
1590        #[prost(uint32, tag = "2")]
1591        GoodTilBlock(u32),
1592        /// good_til_block_time represents the unix timestamp (in seconds) at which a
1593        /// stateful order cancellation will be considered expired. The
1594        /// good_til_block_time is always evaluated against the previous block's
1595        /// `BlockTime` instead of the block in which the order is committed.
1596        /// This value must be zero for Short-Term orders.
1597        #[prost(fixed32, tag = "3")]
1598        GoodTilBlockTime(u32),
1599    }
1600}
1601impl ::prost::Name for MsgCancelOrder {
1602    const NAME: &'static str = "MsgCancelOrder";
1603    const PACKAGE: &'static str = "dydxprotocol.clob";
1604    fn full_name() -> ::prost::alloc::string::String {
1605        "dydxprotocol.clob.MsgCancelOrder".into()
1606    }
1607    fn type_url() -> ::prost::alloc::string::String {
1608        "/dydxprotocol.clob.MsgCancelOrder".into()
1609    }
1610}
1611/// MsgCancelOrderResponse is a response type used for canceling orders.
1612#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1613pub struct MsgCancelOrderResponse {}
1614impl ::prost::Name for MsgCancelOrderResponse {
1615    const NAME: &'static str = "MsgCancelOrderResponse";
1616    const PACKAGE: &'static str = "dydxprotocol.clob";
1617    fn full_name() -> ::prost::alloc::string::String {
1618        "dydxprotocol.clob.MsgCancelOrderResponse".into()
1619    }
1620    fn type_url() -> ::prost::alloc::string::String {
1621        "/dydxprotocol.clob.MsgCancelOrderResponse".into()
1622    }
1623}
1624/// MsgBatchCancel is a request type used for batch canceling orders.
1625/// This msg is not atomic. Cancels will be performed optimistically even
1626/// if some cancels are invalid or fail.
1627#[derive(Clone, PartialEq, ::prost::Message)]
1628pub struct MsgBatchCancel {
1629    /// The subaccount this batch cancel will be applied for.
1630    #[prost(message, optional, tag = "1")]
1631    pub subaccount_id: ::core::option::Option<super::subaccounts::SubaccountId>,
1632    /// The batch of short term orders that will be cancelled.
1633    #[prost(message, repeated, tag = "2")]
1634    pub short_term_cancels: ::prost::alloc::vec::Vec<OrderBatch>,
1635    /// The last block the short term order cancellations can be executed at.
1636    #[prost(uint32, tag = "3")]
1637    pub good_til_block: u32,
1638}
1639impl ::prost::Name for MsgBatchCancel {
1640    const NAME: &'static str = "MsgBatchCancel";
1641    const PACKAGE: &'static str = "dydxprotocol.clob";
1642    fn full_name() -> ::prost::alloc::string::String {
1643        "dydxprotocol.clob.MsgBatchCancel".into()
1644    }
1645    fn type_url() -> ::prost::alloc::string::String {
1646        "/dydxprotocol.clob.MsgBatchCancel".into()
1647    }
1648}
1649/// OrderBatch represents a batch of orders all belonging to a single clob pair
1650/// id. Along with a subaccount id and an order flag, is used to represent a
1651/// batch of orders that share the same subaccount, order flag, and clob pair id.
1652#[derive(Clone, PartialEq, ::prost::Message)]
1653pub struct OrderBatch {
1654    /// The Clob Pair ID all orders in this order batch belong to.
1655    #[prost(uint32, tag = "1")]
1656    pub clob_pair_id: u32,
1657    /// List of client ids in this order batch.
1658    /// Note that this is serialized as a uint32 instead of a fixed32 to
1659    /// avoid issues when decoding repeated packed fixed32.
1660    #[prost(uint32, repeated, tag = "2")]
1661    pub client_ids: ::prost::alloc::vec::Vec<u32>,
1662}
1663impl ::prost::Name for OrderBatch {
1664    const NAME: &'static str = "OrderBatch";
1665    const PACKAGE: &'static str = "dydxprotocol.clob";
1666    fn full_name() -> ::prost::alloc::string::String {
1667        "dydxprotocol.clob.OrderBatch".into()
1668    }
1669    fn type_url() -> ::prost::alloc::string::String {
1670        "/dydxprotocol.clob.OrderBatch".into()
1671    }
1672}
1673/// MsgBatchCancelResponse is a response type used for batch canceling orders.
1674/// It indicates which cancel orders have succeeded or failed.
1675#[derive(Clone, PartialEq, ::prost::Message)]
1676pub struct MsgBatchCancelResponse {
1677    /// A batch of short term cancel orders that have succeeded.
1678    #[prost(message, repeated, tag = "1")]
1679    pub short_term_succeeded: ::prost::alloc::vec::Vec<OrderBatch>,
1680    /// A batch of short term cancel orders that have failed.
1681    #[prost(message, repeated, tag = "2")]
1682    pub short_term_failed: ::prost::alloc::vec::Vec<OrderBatch>,
1683}
1684impl ::prost::Name for MsgBatchCancelResponse {
1685    const NAME: &'static str = "MsgBatchCancelResponse";
1686    const PACKAGE: &'static str = "dydxprotocol.clob";
1687    fn full_name() -> ::prost::alloc::string::String {
1688        "dydxprotocol.clob.MsgBatchCancelResponse".into()
1689    }
1690    fn type_url() -> ::prost::alloc::string::String {
1691        "/dydxprotocol.clob.MsgBatchCancelResponse".into()
1692    }
1693}
1694/// MsgUpdateClobPair is a request type used for updating a ClobPair in state.
1695#[derive(Clone, PartialEq, ::prost::Message)]
1696pub struct MsgUpdateClobPair {
1697    /// Authority is the address that may send this message.
1698    #[prost(string, tag = "1")]
1699    pub authority: ::prost::alloc::string::String,
1700    /// `clob_pair` is the ClobPair to write to state.
1701    #[prost(message, optional, tag = "2")]
1702    pub clob_pair: ::core::option::Option<ClobPair>,
1703}
1704impl ::prost::Name for MsgUpdateClobPair {
1705    const NAME: &'static str = "MsgUpdateClobPair";
1706    const PACKAGE: &'static str = "dydxprotocol.clob";
1707    fn full_name() -> ::prost::alloc::string::String {
1708        "dydxprotocol.clob.MsgUpdateClobPair".into()
1709    }
1710    fn type_url() -> ::prost::alloc::string::String {
1711        "/dydxprotocol.clob.MsgUpdateClobPair".into()
1712    }
1713}
1714/// MsgUpdateClobPairResponse is a response type used for setting a ClobPair's
1715/// status.
1716#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1717pub struct MsgUpdateClobPairResponse {}
1718impl ::prost::Name for MsgUpdateClobPairResponse {
1719    const NAME: &'static str = "MsgUpdateClobPairResponse";
1720    const PACKAGE: &'static str = "dydxprotocol.clob";
1721    fn full_name() -> ::prost::alloc::string::String {
1722        "dydxprotocol.clob.MsgUpdateClobPairResponse".into()
1723    }
1724    fn type_url() -> ::prost::alloc::string::String {
1725        "/dydxprotocol.clob.MsgUpdateClobPairResponse".into()
1726    }
1727}
1728/// OperationRaw represents an operation in the proposed operations.
1729/// Note that the `order_placement` operation is a signed message.
1730#[derive(Clone, PartialEq, ::prost::Message)]
1731pub struct OperationRaw {
1732    /// operationRaw represents an operation that occurred, which can be a match,
1733    /// a signed order placement, or an order removal.
1734    #[prost(oneof = "operation_raw::Operation", tags = "1, 2, 3")]
1735    pub operation: ::core::option::Option<operation_raw::Operation>,
1736}
1737/// Nested message and enum types in `OperationRaw`.
1738pub mod operation_raw {
1739    /// operationRaw represents an operation that occurred, which can be a match,
1740    /// a signed order placement, or an order removal.
1741    #[derive(Clone, PartialEq, ::prost::Oneof)]
1742    pub enum Operation {
1743        #[prost(message, tag = "1")]
1744        Match(super::ClobMatch),
1745        #[prost(bytes, tag = "2")]
1746        ShortTermOrderPlacement(::prost::alloc::vec::Vec<u8>),
1747        #[prost(message, tag = "3")]
1748        OrderRemoval(super::OrderRemoval),
1749    }
1750}
1751impl ::prost::Name for OperationRaw {
1752    const NAME: &'static str = "OperationRaw";
1753    const PACKAGE: &'static str = "dydxprotocol.clob";
1754    fn full_name() -> ::prost::alloc::string::String {
1755        "dydxprotocol.clob.OperationRaw".into()
1756    }
1757    fn type_url() -> ::prost::alloc::string::String {
1758        "/dydxprotocol.clob.OperationRaw".into()
1759    }
1760}
1761/// MsgUpdateEquityTierLimitConfiguration is the Msg/EquityTierLimitConfiguration
1762/// request type.
1763#[derive(Clone, PartialEq, ::prost::Message)]
1764pub struct MsgUpdateEquityTierLimitConfiguration {
1765    #[prost(string, tag = "1")]
1766    pub authority: ::prost::alloc::string::String,
1767    /// Defines the equity tier limit configuration to update to. All fields must
1768    /// be set.
1769    #[prost(message, optional, tag = "2")]
1770    pub equity_tier_limit_config: ::core::option::Option<EquityTierLimitConfiguration>,
1771}
1772impl ::prost::Name for MsgUpdateEquityTierLimitConfiguration {
1773    const NAME: &'static str = "MsgUpdateEquityTierLimitConfiguration";
1774    const PACKAGE: &'static str = "dydxprotocol.clob";
1775    fn full_name() -> ::prost::alloc::string::String {
1776        "dydxprotocol.clob.MsgUpdateEquityTierLimitConfiguration".into()
1777    }
1778    fn type_url() -> ::prost::alloc::string::String {
1779        "/dydxprotocol.clob.MsgUpdateEquityTierLimitConfiguration".into()
1780    }
1781}
1782/// MsgUpdateEquityTierLimitConfiguration is the Msg/EquityTierLimitConfiguration
1783/// response type.
1784#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1785pub struct MsgUpdateEquityTierLimitConfigurationResponse {}
1786impl ::prost::Name for MsgUpdateEquityTierLimitConfigurationResponse {
1787    const NAME: &'static str = "MsgUpdateEquityTierLimitConfigurationResponse";
1788    const PACKAGE: &'static str = "dydxprotocol.clob";
1789    fn full_name() -> ::prost::alloc::string::String {
1790        "dydxprotocol.clob.MsgUpdateEquityTierLimitConfigurationResponse".into()
1791    }
1792    fn type_url() -> ::prost::alloc::string::String {
1793        "/dydxprotocol.clob.MsgUpdateEquityTierLimitConfigurationResponse".into()
1794    }
1795}
1796/// MsgUpdateBlockRateLimitConfiguration is the Msg/BlockRateLimitConfiguration
1797/// request type.
1798#[derive(Clone, PartialEq, ::prost::Message)]
1799pub struct MsgUpdateBlockRateLimitConfiguration {
1800    #[prost(string, tag = "1")]
1801    pub authority: ::prost::alloc::string::String,
1802    /// Defines the block rate limit configuration to update to. All fields must be
1803    /// set.
1804    #[prost(message, optional, tag = "3")]
1805    pub block_rate_limit_config: ::core::option::Option<BlockRateLimitConfiguration>,
1806}
1807impl ::prost::Name for MsgUpdateBlockRateLimitConfiguration {
1808    const NAME: &'static str = "MsgUpdateBlockRateLimitConfiguration";
1809    const PACKAGE: &'static str = "dydxprotocol.clob";
1810    fn full_name() -> ::prost::alloc::string::String {
1811        "dydxprotocol.clob.MsgUpdateBlockRateLimitConfiguration".into()
1812    }
1813    fn type_url() -> ::prost::alloc::string::String {
1814        "/dydxprotocol.clob.MsgUpdateBlockRateLimitConfiguration".into()
1815    }
1816}
1817/// MsgUpdateBlockRateLimitConfiguration is a response type for updating the
1818/// liquidations config.
1819#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1820pub struct MsgUpdateBlockRateLimitConfigurationResponse {}
1821impl ::prost::Name for MsgUpdateBlockRateLimitConfigurationResponse {
1822    const NAME: &'static str = "MsgUpdateBlockRateLimitConfigurationResponse";
1823    const PACKAGE: &'static str = "dydxprotocol.clob";
1824    fn full_name() -> ::prost::alloc::string::String {
1825        "dydxprotocol.clob.MsgUpdateBlockRateLimitConfigurationResponse".into()
1826    }
1827    fn type_url() -> ::prost::alloc::string::String {
1828        "/dydxprotocol.clob.MsgUpdateBlockRateLimitConfigurationResponse".into()
1829    }
1830}
1831/// MsgUpdateLiquidationsConfig is a request type for updating the liquidations
1832/// config.
1833#[derive(Clone, PartialEq, ::prost::Message)]
1834pub struct MsgUpdateLiquidationsConfig {
1835    /// Authority is the address that may send this message.
1836    #[prost(string, tag = "1")]
1837    pub authority: ::prost::alloc::string::String,
1838    /// Defines the liquidations configuration to update to. All fields must
1839    /// be set.
1840    #[prost(message, optional, tag = "2")]
1841    pub liquidations_config: ::core::option::Option<LiquidationsConfig>,
1842}
1843impl ::prost::Name for MsgUpdateLiquidationsConfig {
1844    const NAME: &'static str = "MsgUpdateLiquidationsConfig";
1845    const PACKAGE: &'static str = "dydxprotocol.clob";
1846    fn full_name() -> ::prost::alloc::string::String {
1847        "dydxprotocol.clob.MsgUpdateLiquidationsConfig".into()
1848    }
1849    fn type_url() -> ::prost::alloc::string::String {
1850        "/dydxprotocol.clob.MsgUpdateLiquidationsConfig".into()
1851    }
1852}
1853/// MsgUpdateLiquidationsConfig is the Msg/LiquidationsConfig response type.
1854#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1855pub struct MsgUpdateLiquidationsConfigResponse {}
1856impl ::prost::Name for MsgUpdateLiquidationsConfigResponse {
1857    const NAME: &'static str = "MsgUpdateLiquidationsConfigResponse";
1858    const PACKAGE: &'static str = "dydxprotocol.clob";
1859    fn full_name() -> ::prost::alloc::string::String {
1860        "dydxprotocol.clob.MsgUpdateLiquidationsConfigResponse".into()
1861    }
1862    fn type_url() -> ::prost::alloc::string::String {
1863        "/dydxprotocol.clob.MsgUpdateLiquidationsConfigResponse".into()
1864    }
1865}
1866/// Generated client implementations.
1867pub mod msg_client {
1868    #![allow(
1869        unused_variables,
1870        dead_code,
1871        missing_docs,
1872        clippy::wildcard_imports,
1873        clippy::let_unit_value,
1874    )]
1875    use tonic::codegen::*;
1876    use tonic::codegen::http::Uri;
1877    /// Msg defines the Msg service.
1878    #[derive(Debug, Clone)]
1879    pub struct MsgClient<T> {
1880        inner: tonic::client::Grpc<T>,
1881    }
1882    #[cfg(feature = "grpc-transport")]
1883    impl MsgClient<tonic::transport::Channel> {
1884        /// Attempt to create a new client by connecting to a given endpoint.
1885        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1886        where
1887            D: TryInto<tonic::transport::Endpoint>,
1888            D::Error: Into<StdError>,
1889        {
1890            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1891            Ok(Self::new(conn))
1892        }
1893    }
1894    impl<T> MsgClient<T>
1895    where
1896        T: tonic::client::GrpcService<tonic::body::Body>,
1897        T::Error: Into<StdError>,
1898        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1899        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1900    {
1901        pub fn new(inner: T) -> Self {
1902            let inner = tonic::client::Grpc::new(inner);
1903            Self { inner }
1904        }
1905        pub fn with_origin(inner: T, origin: Uri) -> Self {
1906            let inner = tonic::client::Grpc::with_origin(inner, origin);
1907            Self { inner }
1908        }
1909        pub fn with_interceptor<F>(
1910            inner: T,
1911            interceptor: F,
1912        ) -> MsgClient<InterceptedService<T, F>>
1913        where
1914            F: tonic::service::Interceptor,
1915            T::ResponseBody: Default,
1916            T: tonic::codegen::Service<
1917                http::Request<tonic::body::Body>,
1918                Response = http::Response<
1919                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
1920                >,
1921            >,
1922            <T as tonic::codegen::Service<
1923                http::Request<tonic::body::Body>,
1924            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1925        {
1926            MsgClient::new(InterceptedService::new(inner, interceptor))
1927        }
1928        /// Compress requests with the given encoding.
1929        ///
1930        /// This requires the server to support it otherwise it might respond with an
1931        /// error.
1932        #[must_use]
1933        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1934            self.inner = self.inner.send_compressed(encoding);
1935            self
1936        }
1937        /// Enable decompressing responses.
1938        #[must_use]
1939        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1940            self.inner = self.inner.accept_compressed(encoding);
1941            self
1942        }
1943        /// Limits the maximum size of a decoded message.
1944        ///
1945        /// Default: `4MB`
1946        #[must_use]
1947        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1948            self.inner = self.inner.max_decoding_message_size(limit);
1949            self
1950        }
1951        /// Limits the maximum size of an encoded message.
1952        ///
1953        /// Default: `usize::MAX`
1954        #[must_use]
1955        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1956            self.inner = self.inner.max_encoding_message_size(limit);
1957            self
1958        }
1959        /// ProposedOperations is a temporary message used by block proposers
1960        /// for matching orders as part of the ABCI++ workaround.
1961        pub async fn proposed_operations(
1962            &mut self,
1963            request: impl tonic::IntoRequest<super::MsgProposedOperations>,
1964        ) -> std::result::Result<
1965            tonic::Response<super::MsgProposedOperationsResponse>,
1966            tonic::Status,
1967        > {
1968            self.inner
1969                .ready()
1970                .await
1971                .map_err(|e| {
1972                    tonic::Status::unknown(
1973                        format!("Service was not ready: {}", e.into()),
1974                    )
1975                })?;
1976            let codec = tonic::codec::ProstCodec::default();
1977            let path = http::uri::PathAndQuery::from_static(
1978                "/dydxprotocol.clob.Msg/ProposedOperations",
1979            );
1980            let mut req = request.into_request();
1981            req.extensions_mut()
1982                .insert(GrpcMethod::new("dydxprotocol.clob.Msg", "ProposedOperations"));
1983            self.inner.unary(req, path, codec).await
1984        }
1985        /// PlaceOrder allows accounts to place orders on the orderbook.
1986        pub async fn place_order(
1987            &mut self,
1988            request: impl tonic::IntoRequest<super::MsgPlaceOrder>,
1989        ) -> std::result::Result<
1990            tonic::Response<super::MsgPlaceOrderResponse>,
1991            tonic::Status,
1992        > {
1993            self.inner
1994                .ready()
1995                .await
1996                .map_err(|e| {
1997                    tonic::Status::unknown(
1998                        format!("Service was not ready: {}", e.into()),
1999                    )
2000                })?;
2001            let codec = tonic::codec::ProstCodec::default();
2002            let path = http::uri::PathAndQuery::from_static(
2003                "/dydxprotocol.clob.Msg/PlaceOrder",
2004            );
2005            let mut req = request.into_request();
2006            req.extensions_mut()
2007                .insert(GrpcMethod::new("dydxprotocol.clob.Msg", "PlaceOrder"));
2008            self.inner.unary(req, path, codec).await
2009        }
2010        /// CancelOrder allows accounts to cancel existing orders on the orderbook.
2011        pub async fn cancel_order(
2012            &mut self,
2013            request: impl tonic::IntoRequest<super::MsgCancelOrder>,
2014        ) -> std::result::Result<
2015            tonic::Response<super::MsgCancelOrderResponse>,
2016            tonic::Status,
2017        > {
2018            self.inner
2019                .ready()
2020                .await
2021                .map_err(|e| {
2022                    tonic::Status::unknown(
2023                        format!("Service was not ready: {}", e.into()),
2024                    )
2025                })?;
2026            let codec = tonic::codec::ProstCodec::default();
2027            let path = http::uri::PathAndQuery::from_static(
2028                "/dydxprotocol.clob.Msg/CancelOrder",
2029            );
2030            let mut req = request.into_request();
2031            req.extensions_mut()
2032                .insert(GrpcMethod::new("dydxprotocol.clob.Msg", "CancelOrder"));
2033            self.inner.unary(req, path, codec).await
2034        }
2035        /// BatchCancel allows accounts to cancel a batch of orders on the orderbook.
2036        pub async fn batch_cancel(
2037            &mut self,
2038            request: impl tonic::IntoRequest<super::MsgBatchCancel>,
2039        ) -> std::result::Result<
2040            tonic::Response<super::MsgBatchCancelResponse>,
2041            tonic::Status,
2042        > {
2043            self.inner
2044                .ready()
2045                .await
2046                .map_err(|e| {
2047                    tonic::Status::unknown(
2048                        format!("Service was not ready: {}", e.into()),
2049                    )
2050                })?;
2051            let codec = tonic::codec::ProstCodec::default();
2052            let path = http::uri::PathAndQuery::from_static(
2053                "/dydxprotocol.clob.Msg/BatchCancel",
2054            );
2055            let mut req = request.into_request();
2056            req.extensions_mut()
2057                .insert(GrpcMethod::new("dydxprotocol.clob.Msg", "BatchCancel"));
2058            self.inner.unary(req, path, codec).await
2059        }
2060        /// CreateClobPair creates a new clob pair.
2061        pub async fn create_clob_pair(
2062            &mut self,
2063            request: impl tonic::IntoRequest<super::MsgCreateClobPair>,
2064        ) -> std::result::Result<
2065            tonic::Response<super::MsgCreateClobPairResponse>,
2066            tonic::Status,
2067        > {
2068            self.inner
2069                .ready()
2070                .await
2071                .map_err(|e| {
2072                    tonic::Status::unknown(
2073                        format!("Service was not ready: {}", e.into()),
2074                    )
2075                })?;
2076            let codec = tonic::codec::ProstCodec::default();
2077            let path = http::uri::PathAndQuery::from_static(
2078                "/dydxprotocol.clob.Msg/CreateClobPair",
2079            );
2080            let mut req = request.into_request();
2081            req.extensions_mut()
2082                .insert(GrpcMethod::new("dydxprotocol.clob.Msg", "CreateClobPair"));
2083            self.inner.unary(req, path, codec).await
2084        }
2085        /// UpdateClobPair sets the status of a clob pair. Should return an error
2086        /// if the authority is not in the clob keeper's set of authorities,
2087        /// if the ClobPair id is not found in state, or if the update includes
2088        /// an unsupported status transition.
2089        pub async fn update_clob_pair(
2090            &mut self,
2091            request: impl tonic::IntoRequest<super::MsgUpdateClobPair>,
2092        ) -> std::result::Result<
2093            tonic::Response<super::MsgUpdateClobPairResponse>,
2094            tonic::Status,
2095        > {
2096            self.inner
2097                .ready()
2098                .await
2099                .map_err(|e| {
2100                    tonic::Status::unknown(
2101                        format!("Service was not ready: {}", e.into()),
2102                    )
2103                })?;
2104            let codec = tonic::codec::ProstCodec::default();
2105            let path = http::uri::PathAndQuery::from_static(
2106                "/dydxprotocol.clob.Msg/UpdateClobPair",
2107            );
2108            let mut req = request.into_request();
2109            req.extensions_mut()
2110                .insert(GrpcMethod::new("dydxprotocol.clob.Msg", "UpdateClobPair"));
2111            self.inner.unary(req, path, codec).await
2112        }
2113        /// UpdateEquityTierLimitConfiguration updates the equity tier limit
2114        /// configuration in state.
2115        pub async fn update_equity_tier_limit_configuration(
2116            &mut self,
2117            request: impl tonic::IntoRequest<
2118                super::MsgUpdateEquityTierLimitConfiguration,
2119            >,
2120        ) -> std::result::Result<
2121            tonic::Response<super::MsgUpdateEquityTierLimitConfigurationResponse>,
2122            tonic::Status,
2123        > {
2124            self.inner
2125                .ready()
2126                .await
2127                .map_err(|e| {
2128                    tonic::Status::unknown(
2129                        format!("Service was not ready: {}", e.into()),
2130                    )
2131                })?;
2132            let codec = tonic::codec::ProstCodec::default();
2133            let path = http::uri::PathAndQuery::from_static(
2134                "/dydxprotocol.clob.Msg/UpdateEquityTierLimitConfiguration",
2135            );
2136            let mut req = request.into_request();
2137            req.extensions_mut()
2138                .insert(
2139                    GrpcMethod::new(
2140                        "dydxprotocol.clob.Msg",
2141                        "UpdateEquityTierLimitConfiguration",
2142                    ),
2143                );
2144            self.inner.unary(req, path, codec).await
2145        }
2146        /// UpdateBlockRateLimitConfiguration updates the block rate limit
2147        /// configuration in state.
2148        pub async fn update_block_rate_limit_configuration(
2149            &mut self,
2150            request: impl tonic::IntoRequest<super::MsgUpdateBlockRateLimitConfiguration>,
2151        ) -> std::result::Result<
2152            tonic::Response<super::MsgUpdateBlockRateLimitConfigurationResponse>,
2153            tonic::Status,
2154        > {
2155            self.inner
2156                .ready()
2157                .await
2158                .map_err(|e| {
2159                    tonic::Status::unknown(
2160                        format!("Service was not ready: {}", e.into()),
2161                    )
2162                })?;
2163            let codec = tonic::codec::ProstCodec::default();
2164            let path = http::uri::PathAndQuery::from_static(
2165                "/dydxprotocol.clob.Msg/UpdateBlockRateLimitConfiguration",
2166            );
2167            let mut req = request.into_request();
2168            req.extensions_mut()
2169                .insert(
2170                    GrpcMethod::new(
2171                        "dydxprotocol.clob.Msg",
2172                        "UpdateBlockRateLimitConfiguration",
2173                    ),
2174                );
2175            self.inner.unary(req, path, codec).await
2176        }
2177        /// UpdateLiquidationsConfig updates the liquidations configuration in state.
2178        pub async fn update_liquidations_config(
2179            &mut self,
2180            request: impl tonic::IntoRequest<super::MsgUpdateLiquidationsConfig>,
2181        ) -> std::result::Result<
2182            tonic::Response<super::MsgUpdateLiquidationsConfigResponse>,
2183            tonic::Status,
2184        > {
2185            self.inner
2186                .ready()
2187                .await
2188                .map_err(|e| {
2189                    tonic::Status::unknown(
2190                        format!("Service was not ready: {}", e.into()),
2191                    )
2192                })?;
2193            let codec = tonic::codec::ProstCodec::default();
2194            let path = http::uri::PathAndQuery::from_static(
2195                "/dydxprotocol.clob.Msg/UpdateLiquidationsConfig",
2196            );
2197            let mut req = request.into_request();
2198            req.extensions_mut()
2199                .insert(
2200                    GrpcMethod::new("dydxprotocol.clob.Msg", "UpdateLiquidationsConfig"),
2201                );
2202            self.inner.unary(req, path, codec).await
2203        }
2204    }
2205}
2206/// Operation represents an operation in the proposed operations. Operation is
2207/// used internally within the memclob only.
2208#[derive(Clone, PartialEq, ::prost::Message)]
2209pub struct Operation {
2210    /// operation represents the operation that occurred, which can be a match,
2211    /// short term order placement, short term order cancellation, or the placement
2212    /// of a pre-existing stateful order.
2213    #[prost(oneof = "operation::Operation", tags = "1, 2, 3, 4")]
2214    pub operation: ::core::option::Option<operation::Operation>,
2215}
2216/// Nested message and enum types in `Operation`.
2217pub mod operation {
2218    /// operation represents the operation that occurred, which can be a match,
2219    /// short term order placement, short term order cancellation, or the placement
2220    /// of a pre-existing stateful order.
2221    #[derive(Clone, PartialEq, ::prost::Oneof)]
2222    pub enum Operation {
2223        #[prost(message, tag = "1")]
2224        Match(super::ClobMatch),
2225        #[prost(message, tag = "2")]
2226        ShortTermOrderPlacement(super::MsgPlaceOrder),
2227        #[prost(message, tag = "3")]
2228        ShortTermOrderCancellation(super::MsgCancelOrder),
2229        #[prost(message, tag = "4")]
2230        PreexistingStatefulOrder(super::OrderId),
2231    }
2232}
2233impl ::prost::Name for Operation {
2234    const NAME: &'static str = "Operation";
2235    const PACKAGE: &'static str = "dydxprotocol.clob";
2236    fn full_name() -> ::prost::alloc::string::String {
2237        "dydxprotocol.clob.Operation".into()
2238    }
2239    fn type_url() -> ::prost::alloc::string::String {
2240        "/dydxprotocol.clob.Operation".into()
2241    }
2242}
2243/// InternalOperation represents an internal operation in the operations to
2244/// propose. InternalOperation is used internally within the memclob only.
2245#[derive(Clone, PartialEq, ::prost::Message)]
2246pub struct InternalOperation {
2247    /// operation represents the operation that occurred, which can be a match,
2248    /// Short-Term order placement, or the placement of a pre-existing stateful
2249    /// order.
2250    #[prost(oneof = "internal_operation::Operation", tags = "1, 2, 3, 4")]
2251    pub operation: ::core::option::Option<internal_operation::Operation>,
2252}
2253/// Nested message and enum types in `InternalOperation`.
2254pub mod internal_operation {
2255    /// operation represents the operation that occurred, which can be a match,
2256    /// Short-Term order placement, or the placement of a pre-existing stateful
2257    /// order.
2258    #[derive(Clone, PartialEq, ::prost::Oneof)]
2259    pub enum Operation {
2260        #[prost(message, tag = "1")]
2261        Match(super::ClobMatch),
2262        #[prost(message, tag = "2")]
2263        ShortTermOrderPlacement(super::MsgPlaceOrder),
2264        #[prost(message, tag = "3")]
2265        PreexistingStatefulOrder(super::OrderId),
2266        #[prost(message, tag = "4")]
2267        OrderRemoval(super::OrderRemoval),
2268    }
2269}
2270impl ::prost::Name for InternalOperation {
2271    const NAME: &'static str = "InternalOperation";
2272    const PACKAGE: &'static str = "dydxprotocol.clob";
2273    fn full_name() -> ::prost::alloc::string::String {
2274        "dydxprotocol.clob.InternalOperation".into()
2275    }
2276    fn type_url() -> ::prost::alloc::string::String {
2277        "/dydxprotocol.clob.InternalOperation".into()
2278    }
2279}
2280/// ProcessProposerMatchesEvents is used for communicating which events occurred
2281/// in the last block that require updating the state of the memclob in the
2282/// Commit blocker. It contains information about the following state updates:
2283/// - Long term order IDs that were placed in the last block.
2284/// - Stateful order IDs that were expired in the last block.
2285/// - Order IDs that were filled in the last block.
2286/// - Stateful cancellations order IDs that were placed in the last block.
2287/// - Stateful order IDs forcefully removed in the last block.
2288/// - Conditional order IDs triggered in the last block.
2289/// - Conditional order IDs placed, but not triggered in the last block.
2290/// - The height of the block in which the events occurred.
2291#[derive(Clone, PartialEq, ::prost::Message)]
2292pub struct ProcessProposerMatchesEvents {
2293    #[deprecated]
2294    #[prost(message, repeated, tag = "1")]
2295    pub placed_long_term_order_ids: ::prost::alloc::vec::Vec<OrderId>,
2296    #[prost(message, repeated, tag = "2")]
2297    pub expired_stateful_order_ids: ::prost::alloc::vec::Vec<OrderId>,
2298    #[prost(message, repeated, tag = "3")]
2299    pub order_ids_filled_in_last_block: ::prost::alloc::vec::Vec<OrderId>,
2300    #[deprecated]
2301    #[prost(message, repeated, tag = "4")]
2302    pub placed_stateful_cancellation_order_ids: ::prost::alloc::vec::Vec<OrderId>,
2303    #[prost(message, repeated, tag = "5")]
2304    pub removed_stateful_order_ids: ::prost::alloc::vec::Vec<OrderId>,
2305    #[prost(message, repeated, tag = "6")]
2306    pub conditional_order_ids_triggered_in_last_block: ::prost::alloc::vec::Vec<OrderId>,
2307    #[deprecated]
2308    #[prost(message, repeated, tag = "7")]
2309    pub placed_conditional_order_ids: ::prost::alloc::vec::Vec<OrderId>,
2310    #[prost(uint32, tag = "8")]
2311    pub block_height: u32,
2312}
2313impl ::prost::Name for ProcessProposerMatchesEvents {
2314    const NAME: &'static str = "ProcessProposerMatchesEvents";
2315    const PACKAGE: &'static str = "dydxprotocol.clob";
2316    fn full_name() -> ::prost::alloc::string::String {
2317        "dydxprotocol.clob.ProcessProposerMatchesEvents".into()
2318    }
2319    fn type_url() -> ::prost::alloc::string::String {
2320        "/dydxprotocol.clob.ProcessProposerMatchesEvents".into()
2321    }
2322}
2323/// QueryGetClobPairRequest is request type for the ClobPair method.
2324#[derive(Clone, Copy, PartialEq, ::prost::Message)]
2325pub struct QueryGetClobPairRequest {
2326    #[prost(uint32, tag = "1")]
2327    pub id: u32,
2328}
2329impl ::prost::Name for QueryGetClobPairRequest {
2330    const NAME: &'static str = "QueryGetClobPairRequest";
2331    const PACKAGE: &'static str = "dydxprotocol.clob";
2332    fn full_name() -> ::prost::alloc::string::String {
2333        "dydxprotocol.clob.QueryGetClobPairRequest".into()
2334    }
2335    fn type_url() -> ::prost::alloc::string::String {
2336        "/dydxprotocol.clob.QueryGetClobPairRequest".into()
2337    }
2338}
2339/// QueryClobPairResponse is response type for the ClobPair method.
2340#[derive(Clone, Copy, PartialEq, ::prost::Message)]
2341pub struct QueryClobPairResponse {
2342    #[prost(message, optional, tag = "1")]
2343    pub clob_pair: ::core::option::Option<ClobPair>,
2344}
2345impl ::prost::Name for QueryClobPairResponse {
2346    const NAME: &'static str = "QueryClobPairResponse";
2347    const PACKAGE: &'static str = "dydxprotocol.clob";
2348    fn full_name() -> ::prost::alloc::string::String {
2349        "dydxprotocol.clob.QueryClobPairResponse".into()
2350    }
2351    fn type_url() -> ::prost::alloc::string::String {
2352        "/dydxprotocol.clob.QueryClobPairResponse".into()
2353    }
2354}
2355/// QueryAllClobPairRequest is request type for the ClobPairAll method.
2356#[derive(Clone, PartialEq, ::prost::Message)]
2357pub struct QueryAllClobPairRequest {
2358    #[prost(message, optional, tag = "1")]
2359    pub pagination: ::core::option::Option<
2360        super::super::cosmos::base::query::v1beta1::PageRequest,
2361    >,
2362}
2363impl ::prost::Name for QueryAllClobPairRequest {
2364    const NAME: &'static str = "QueryAllClobPairRequest";
2365    const PACKAGE: &'static str = "dydxprotocol.clob";
2366    fn full_name() -> ::prost::alloc::string::String {
2367        "dydxprotocol.clob.QueryAllClobPairRequest".into()
2368    }
2369    fn type_url() -> ::prost::alloc::string::String {
2370        "/dydxprotocol.clob.QueryAllClobPairRequest".into()
2371    }
2372}
2373/// QueryClobPairAllResponse is response type for the ClobPairAll method.
2374#[derive(Clone, PartialEq, ::prost::Message)]
2375pub struct QueryClobPairAllResponse {
2376    #[prost(message, repeated, tag = "1")]
2377    pub clob_pair: ::prost::alloc::vec::Vec<ClobPair>,
2378    #[prost(message, optional, tag = "2")]
2379    pub pagination: ::core::option::Option<
2380        super::super::cosmos::base::query::v1beta1::PageResponse,
2381    >,
2382}
2383impl ::prost::Name for QueryClobPairAllResponse {
2384    const NAME: &'static str = "QueryClobPairAllResponse";
2385    const PACKAGE: &'static str = "dydxprotocol.clob";
2386    fn full_name() -> ::prost::alloc::string::String {
2387        "dydxprotocol.clob.QueryClobPairAllResponse".into()
2388    }
2389    fn type_url() -> ::prost::alloc::string::String {
2390        "/dydxprotocol.clob.QueryClobPairAllResponse".into()
2391    }
2392}
2393/// MevNodeToNodeCalculationRequest is a request message used to run the
2394/// MEV node <> node calculation.
2395#[derive(Clone, PartialEq, ::prost::Message)]
2396pub struct MevNodeToNodeCalculationRequest {
2397    /// Represents the matches on the "block proposer". Note that this field
2398    /// does not need to be the actual block proposer's matches for a block, since
2399    /// the MEV calculation logic is run with this nodes matches as the "block
2400    /// proposer" matches.
2401    #[prost(message, optional, tag = "1")]
2402    pub block_proposer_matches: ::core::option::Option<ValidatorMevMatches>,
2403    /// Represents the matches and mid-prices on the validator.
2404    #[prost(message, optional, tag = "2")]
2405    pub validator_mev_metrics: ::core::option::Option<MevNodeToNodeMetrics>,
2406}
2407impl ::prost::Name for MevNodeToNodeCalculationRequest {
2408    const NAME: &'static str = "MevNodeToNodeCalculationRequest";
2409    const PACKAGE: &'static str = "dydxprotocol.clob";
2410    fn full_name() -> ::prost::alloc::string::String {
2411        "dydxprotocol.clob.MevNodeToNodeCalculationRequest".into()
2412    }
2413    fn type_url() -> ::prost::alloc::string::String {
2414        "/dydxprotocol.clob.MevNodeToNodeCalculationRequest".into()
2415    }
2416}
2417/// MevNodeToNodeCalculationResponse is a response message that contains the
2418/// MEV node <> node calculation result.
2419#[derive(Clone, PartialEq, ::prost::Message)]
2420pub struct MevNodeToNodeCalculationResponse {
2421    #[prost(message, repeated, tag = "1")]
2422    pub results: ::prost::alloc::vec::Vec<
2423        mev_node_to_node_calculation_response::MevAndVolumePerClob,
2424    >,
2425}
2426/// Nested message and enum types in `MevNodeToNodeCalculationResponse`.
2427pub mod mev_node_to_node_calculation_response {
2428    /// MevAndVolumePerClob contains information about the MEV and volume per CLOB.
2429    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2430    pub struct MevAndVolumePerClob {
2431        #[prost(uint32, tag = "1")]
2432        pub clob_pair_id: u32,
2433        #[prost(float, tag = "2")]
2434        pub mev: f32,
2435        #[prost(uint64, tag = "3")]
2436        pub volume: u64,
2437    }
2438    impl ::prost::Name for MevAndVolumePerClob {
2439        const NAME: &'static str = "MevAndVolumePerClob";
2440        const PACKAGE: &'static str = "dydxprotocol.clob";
2441        fn full_name() -> ::prost::alloc::string::String {
2442            "dydxprotocol.clob.MevNodeToNodeCalculationResponse.MevAndVolumePerClob"
2443                .into()
2444        }
2445        fn type_url() -> ::prost::alloc::string::String {
2446            "/dydxprotocol.clob.MevNodeToNodeCalculationResponse.MevAndVolumePerClob"
2447                .into()
2448        }
2449    }
2450}
2451impl ::prost::Name for MevNodeToNodeCalculationResponse {
2452    const NAME: &'static str = "MevNodeToNodeCalculationResponse";
2453    const PACKAGE: &'static str = "dydxprotocol.clob";
2454    fn full_name() -> ::prost::alloc::string::String {
2455        "dydxprotocol.clob.MevNodeToNodeCalculationResponse".into()
2456    }
2457    fn type_url() -> ::prost::alloc::string::String {
2458        "/dydxprotocol.clob.MevNodeToNodeCalculationResponse".into()
2459    }
2460}
2461/// QueryEquityTierLimitConfigurationRequest is a request message for
2462/// EquityTierLimitConfiguration.
2463#[derive(Clone, Copy, PartialEq, ::prost::Message)]
2464pub struct QueryEquityTierLimitConfigurationRequest {}
2465impl ::prost::Name for QueryEquityTierLimitConfigurationRequest {
2466    const NAME: &'static str = "QueryEquityTierLimitConfigurationRequest";
2467    const PACKAGE: &'static str = "dydxprotocol.clob";
2468    fn full_name() -> ::prost::alloc::string::String {
2469        "dydxprotocol.clob.QueryEquityTierLimitConfigurationRequest".into()
2470    }
2471    fn type_url() -> ::prost::alloc::string::String {
2472        "/dydxprotocol.clob.QueryEquityTierLimitConfigurationRequest".into()
2473    }
2474}
2475/// QueryEquityTierLimitConfigurationResponse is a response message that contains
2476/// the EquityTierLimitConfiguration.
2477#[derive(Clone, PartialEq, ::prost::Message)]
2478pub struct QueryEquityTierLimitConfigurationResponse {
2479    #[prost(message, optional, tag = "1")]
2480    pub equity_tier_limit_config: ::core::option::Option<EquityTierLimitConfiguration>,
2481}
2482impl ::prost::Name for QueryEquityTierLimitConfigurationResponse {
2483    const NAME: &'static str = "QueryEquityTierLimitConfigurationResponse";
2484    const PACKAGE: &'static str = "dydxprotocol.clob";
2485    fn full_name() -> ::prost::alloc::string::String {
2486        "dydxprotocol.clob.QueryEquityTierLimitConfigurationResponse".into()
2487    }
2488    fn type_url() -> ::prost::alloc::string::String {
2489        "/dydxprotocol.clob.QueryEquityTierLimitConfigurationResponse".into()
2490    }
2491}
2492/// QueryBlockRateLimitConfigurationRequest is a request message for
2493/// BlockRateLimitConfiguration.
2494#[derive(Clone, Copy, PartialEq, ::prost::Message)]
2495pub struct QueryBlockRateLimitConfigurationRequest {}
2496impl ::prost::Name for QueryBlockRateLimitConfigurationRequest {
2497    const NAME: &'static str = "QueryBlockRateLimitConfigurationRequest";
2498    const PACKAGE: &'static str = "dydxprotocol.clob";
2499    fn full_name() -> ::prost::alloc::string::String {
2500        "dydxprotocol.clob.QueryBlockRateLimitConfigurationRequest".into()
2501    }
2502    fn type_url() -> ::prost::alloc::string::String {
2503        "/dydxprotocol.clob.QueryBlockRateLimitConfigurationRequest".into()
2504    }
2505}
2506/// QueryBlockRateLimitConfigurationResponse is a response message that contains
2507/// the BlockRateLimitConfiguration.
2508#[derive(Clone, PartialEq, ::prost::Message)]
2509pub struct QueryBlockRateLimitConfigurationResponse {
2510    #[prost(message, optional, tag = "1")]
2511    pub block_rate_limit_config: ::core::option::Option<BlockRateLimitConfiguration>,
2512}
2513impl ::prost::Name for QueryBlockRateLimitConfigurationResponse {
2514    const NAME: &'static str = "QueryBlockRateLimitConfigurationResponse";
2515    const PACKAGE: &'static str = "dydxprotocol.clob";
2516    fn full_name() -> ::prost::alloc::string::String {
2517        "dydxprotocol.clob.QueryBlockRateLimitConfigurationResponse".into()
2518    }
2519    fn type_url() -> ::prost::alloc::string::String {
2520        "/dydxprotocol.clob.QueryBlockRateLimitConfigurationResponse".into()
2521    }
2522}
2523/// QueryStatefulOrderRequest is a request message for StatefulOrder.
2524#[derive(Clone, PartialEq, ::prost::Message)]
2525pub struct QueryStatefulOrderRequest {
2526    /// Order id to query.
2527    #[prost(message, optional, tag = "1")]
2528    pub order_id: ::core::option::Option<OrderId>,
2529}
2530impl ::prost::Name for QueryStatefulOrderRequest {
2531    const NAME: &'static str = "QueryStatefulOrderRequest";
2532    const PACKAGE: &'static str = "dydxprotocol.clob";
2533    fn full_name() -> ::prost::alloc::string::String {
2534        "dydxprotocol.clob.QueryStatefulOrderRequest".into()
2535    }
2536    fn type_url() -> ::prost::alloc::string::String {
2537        "/dydxprotocol.clob.QueryStatefulOrderRequest".into()
2538    }
2539}
2540/// QueryStatefulOrderResponse is a response message that contains the stateful
2541/// order.
2542#[derive(Clone, PartialEq, ::prost::Message)]
2543pub struct QueryStatefulOrderResponse {
2544    /// Stateful order placement.
2545    #[prost(message, optional, tag = "1")]
2546    pub order_placement: ::core::option::Option<LongTermOrderPlacement>,
2547    /// Fill amounts.
2548    #[prost(uint64, tag = "2")]
2549    pub fill_amount: u64,
2550    /// Triggered status.
2551    #[prost(bool, tag = "3")]
2552    pub triggered: bool,
2553}
2554impl ::prost::Name for QueryStatefulOrderResponse {
2555    const NAME: &'static str = "QueryStatefulOrderResponse";
2556    const PACKAGE: &'static str = "dydxprotocol.clob";
2557    fn full_name() -> ::prost::alloc::string::String {
2558        "dydxprotocol.clob.QueryStatefulOrderResponse".into()
2559    }
2560    fn type_url() -> ::prost::alloc::string::String {
2561        "/dydxprotocol.clob.QueryStatefulOrderResponse".into()
2562    }
2563}
2564/// QueryLiquidationsConfigurationRequest is a request message for
2565/// LiquidationsConfiguration.
2566#[derive(Clone, Copy, PartialEq, ::prost::Message)]
2567pub struct QueryLiquidationsConfigurationRequest {}
2568impl ::prost::Name for QueryLiquidationsConfigurationRequest {
2569    const NAME: &'static str = "QueryLiquidationsConfigurationRequest";
2570    const PACKAGE: &'static str = "dydxprotocol.clob";
2571    fn full_name() -> ::prost::alloc::string::String {
2572        "dydxprotocol.clob.QueryLiquidationsConfigurationRequest".into()
2573    }
2574    fn type_url() -> ::prost::alloc::string::String {
2575        "/dydxprotocol.clob.QueryLiquidationsConfigurationRequest".into()
2576    }
2577}
2578/// QueryLiquidationsConfigurationResponse is a response message that contains
2579/// the LiquidationsConfiguration.
2580#[derive(Clone, Copy, PartialEq, ::prost::Message)]
2581pub struct QueryLiquidationsConfigurationResponse {
2582    #[prost(message, optional, tag = "1")]
2583    pub liquidations_config: ::core::option::Option<LiquidationsConfig>,
2584}
2585impl ::prost::Name for QueryLiquidationsConfigurationResponse {
2586    const NAME: &'static str = "QueryLiquidationsConfigurationResponse";
2587    const PACKAGE: &'static str = "dydxprotocol.clob";
2588    fn full_name() -> ::prost::alloc::string::String {
2589        "dydxprotocol.clob.QueryLiquidationsConfigurationResponse".into()
2590    }
2591    fn type_url() -> ::prost::alloc::string::String {
2592        "/dydxprotocol.clob.QueryLiquidationsConfigurationResponse".into()
2593    }
2594}
2595/// QueryNextClobPairIdRequest is a request message for the next clob pair id
2596#[derive(Clone, Copy, PartialEq, ::prost::Message)]
2597pub struct QueryNextClobPairIdRequest {}
2598impl ::prost::Name for QueryNextClobPairIdRequest {
2599    const NAME: &'static str = "QueryNextClobPairIdRequest";
2600    const PACKAGE: &'static str = "dydxprotocol.clob";
2601    fn full_name() -> ::prost::alloc::string::String {
2602        "dydxprotocol.clob.QueryNextClobPairIdRequest".into()
2603    }
2604    fn type_url() -> ::prost::alloc::string::String {
2605        "/dydxprotocol.clob.QueryNextClobPairIdRequest".into()
2606    }
2607}
2608/// QueryNextClobPairIdResponse is a response message for the next clob pair id
2609#[derive(Clone, Copy, PartialEq, ::prost::Message)]
2610pub struct QueryNextClobPairIdResponse {
2611    #[prost(uint32, tag = "1")]
2612    pub next_clob_pair_id: u32,
2613}
2614impl ::prost::Name for QueryNextClobPairIdResponse {
2615    const NAME: &'static str = "QueryNextClobPairIdResponse";
2616    const PACKAGE: &'static str = "dydxprotocol.clob";
2617    fn full_name() -> ::prost::alloc::string::String {
2618        "dydxprotocol.clob.QueryNextClobPairIdResponse".into()
2619    }
2620    fn type_url() -> ::prost::alloc::string::String {
2621        "/dydxprotocol.clob.QueryNextClobPairIdResponse".into()
2622    }
2623}
2624/// StreamOrderbookUpdatesRequest is a request message for the
2625/// StreamOrderbookUpdates method.
2626#[derive(Clone, PartialEq, ::prost::Message)]
2627pub struct StreamOrderbookUpdatesRequest {
2628    /// Clob pair ids to stream orderbook updates for.
2629    #[prost(uint32, repeated, tag = "1")]
2630    pub clob_pair_id: ::prost::alloc::vec::Vec<u32>,
2631    /// Subaccount ids to stream subaccount updates for.
2632    #[prost(message, repeated, tag = "2")]
2633    pub subaccount_ids: ::prost::alloc::vec::Vec<super::subaccounts::SubaccountId>,
2634    /// Market ids for price updates.
2635    #[prost(uint32, repeated, tag = "3")]
2636    pub market_ids: ::prost::alloc::vec::Vec<u32>,
2637    /// Filter order updates by subaccount IDs.
2638    /// If true, the orderbook updates only include orders from provided subaccount
2639    /// IDs.
2640    #[prost(bool, tag = "4")]
2641    pub filter_orders_by_subaccount_id: bool,
2642}
2643impl ::prost::Name for StreamOrderbookUpdatesRequest {
2644    const NAME: &'static str = "StreamOrderbookUpdatesRequest";
2645    const PACKAGE: &'static str = "dydxprotocol.clob";
2646    fn full_name() -> ::prost::alloc::string::String {
2647        "dydxprotocol.clob.StreamOrderbookUpdatesRequest".into()
2648    }
2649    fn type_url() -> ::prost::alloc::string::String {
2650        "/dydxprotocol.clob.StreamOrderbookUpdatesRequest".into()
2651    }
2652}
2653/// StreamOrderbookUpdatesResponse is a response message for the
2654/// StreamOrderbookUpdates method.
2655#[derive(Clone, PartialEq, ::prost::Message)]
2656pub struct StreamOrderbookUpdatesResponse {
2657    /// Batch of updates for the clob pair.
2658    #[prost(message, repeated, tag = "1")]
2659    pub updates: ::prost::alloc::vec::Vec<StreamUpdate>,
2660}
2661impl ::prost::Name for StreamOrderbookUpdatesResponse {
2662    const NAME: &'static str = "StreamOrderbookUpdatesResponse";
2663    const PACKAGE: &'static str = "dydxprotocol.clob";
2664    fn full_name() -> ::prost::alloc::string::String {
2665        "dydxprotocol.clob.StreamOrderbookUpdatesResponse".into()
2666    }
2667    fn type_url() -> ::prost::alloc::string::String {
2668        "/dydxprotocol.clob.StreamOrderbookUpdatesResponse".into()
2669    }
2670}
2671/// StreamUpdate is an update that will be pushed through the
2672/// GRPC stream.
2673#[derive(Clone, PartialEq, ::prost::Message)]
2674pub struct StreamUpdate {
2675    /// Block height of the update.
2676    #[prost(uint32, tag = "1")]
2677    pub block_height: u32,
2678    /// Exec mode of the update.
2679    #[prost(uint32, tag = "2")]
2680    pub exec_mode: u32,
2681    /// Contains one of an StreamOrderbookUpdate,
2682    /// StreamOrderbookFill, StreamTakerOrderStatus.
2683    #[prost(oneof = "stream_update::UpdateMessage", tags = "3, 4, 5, 6, 7")]
2684    pub update_message: ::core::option::Option<stream_update::UpdateMessage>,
2685}
2686/// Nested message and enum types in `StreamUpdate`.
2687pub mod stream_update {
2688    /// Contains one of an StreamOrderbookUpdate,
2689    /// StreamOrderbookFill, StreamTakerOrderStatus.
2690    #[derive(Clone, PartialEq, ::prost::Oneof)]
2691    pub enum UpdateMessage {
2692        #[prost(message, tag = "3")]
2693        OrderbookUpdate(super::StreamOrderbookUpdate),
2694        #[prost(message, tag = "4")]
2695        OrderFill(super::StreamOrderbookFill),
2696        #[prost(message, tag = "5")]
2697        TakerOrder(super::StreamTakerOrder),
2698        #[prost(message, tag = "6")]
2699        SubaccountUpdate(super::super::subaccounts::StreamSubaccountUpdate),
2700        #[prost(message, tag = "7")]
2701        PriceUpdate(super::super::prices::StreamPriceUpdate),
2702    }
2703}
2704impl ::prost::Name for StreamUpdate {
2705    const NAME: &'static str = "StreamUpdate";
2706    const PACKAGE: &'static str = "dydxprotocol.clob";
2707    fn full_name() -> ::prost::alloc::string::String {
2708        "dydxprotocol.clob.StreamUpdate".into()
2709    }
2710    fn type_url() -> ::prost::alloc::string::String {
2711        "/dydxprotocol.clob.StreamUpdate".into()
2712    }
2713}
2714/// StreamOrderbookUpdate provides information on an orderbook update. Used in
2715/// the full node GRPC stream.
2716#[derive(Clone, PartialEq, ::prost::Message)]
2717pub struct StreamOrderbookUpdate {
2718    /// Snapshot indicates if the response is from a snapshot of the orderbook.
2719    /// All updates should be ignored until snapshot is recieved.
2720    /// If the snapshot is true, then all previous entries should be
2721    /// discarded and the orderbook should be resynced.
2722    #[prost(bool, tag = "1")]
2723    pub snapshot: bool,
2724    /// Orderbook updates for the clob pair. Can contain order place, removals,
2725    /// or updates.
2726    #[prost(message, repeated, tag = "2")]
2727    pub updates: ::prost::alloc::vec::Vec<
2728        super::indexer::off_chain_updates::OffChainUpdateV1,
2729    >,
2730}
2731impl ::prost::Name for StreamOrderbookUpdate {
2732    const NAME: &'static str = "StreamOrderbookUpdate";
2733    const PACKAGE: &'static str = "dydxprotocol.clob";
2734    fn full_name() -> ::prost::alloc::string::String {
2735        "dydxprotocol.clob.StreamOrderbookUpdate".into()
2736    }
2737    fn type_url() -> ::prost::alloc::string::String {
2738        "/dydxprotocol.clob.StreamOrderbookUpdate".into()
2739    }
2740}
2741/// StreamOrderbookFill provides information on an orderbook fill. Used in
2742/// the full node GRPC stream.
2743#[derive(Clone, PartialEq, ::prost::Message)]
2744pub struct StreamOrderbookFill {
2745    /// Clob match. Provides information on which orders were matched
2746    /// and the type of order.
2747    #[prost(message, optional, tag = "1")]
2748    pub clob_match: ::core::option::Option<ClobMatch>,
2749    /// All orders involved in the specified clob match. Used to look up
2750    /// price of a match through a given maker order id.
2751    #[prost(message, repeated, tag = "2")]
2752    pub orders: ::prost::alloc::vec::Vec<Order>,
2753    /// Resulting fill amounts for each order in the orders array.
2754    #[prost(uint64, repeated, tag = "3")]
2755    pub fill_amounts: ::prost::alloc::vec::Vec<u64>,
2756}
2757impl ::prost::Name for StreamOrderbookFill {
2758    const NAME: &'static str = "StreamOrderbookFill";
2759    const PACKAGE: &'static str = "dydxprotocol.clob";
2760    fn full_name() -> ::prost::alloc::string::String {
2761        "dydxprotocol.clob.StreamOrderbookFill".into()
2762    }
2763    fn type_url() -> ::prost::alloc::string::String {
2764        "/dydxprotocol.clob.StreamOrderbookFill".into()
2765    }
2766}
2767/// StreamTakerOrder provides information on a taker order that was attempted
2768/// to be matched on the orderbook.
2769/// It is intended to be used only in full node streaming.
2770#[derive(Clone, PartialEq, ::prost::Message)]
2771pub struct StreamTakerOrder {
2772    /// Information on the taker order after it is matched on the book,
2773    /// either successfully or unsuccessfully.
2774    #[prost(message, optional, tag = "3")]
2775    pub taker_order_status: ::core::option::Option<StreamTakerOrderStatus>,
2776    /// The taker order that was matched on the orderbook. Can be a
2777    /// regular order or a liquidation order.
2778    #[prost(oneof = "stream_taker_order::TakerOrder", tags = "1, 2")]
2779    pub taker_order: ::core::option::Option<stream_taker_order::TakerOrder>,
2780}
2781/// Nested message and enum types in `StreamTakerOrder`.
2782pub mod stream_taker_order {
2783    /// The taker order that was matched on the orderbook. Can be a
2784    /// regular order or a liquidation order.
2785    #[derive(Clone, PartialEq, ::prost::Oneof)]
2786    pub enum TakerOrder {
2787        #[prost(message, tag = "1")]
2788        Order(super::Order),
2789        #[prost(message, tag = "2")]
2790        LiquidationOrder(super::StreamLiquidationOrder),
2791    }
2792}
2793impl ::prost::Name for StreamTakerOrder {
2794    const NAME: &'static str = "StreamTakerOrder";
2795    const PACKAGE: &'static str = "dydxprotocol.clob";
2796    fn full_name() -> ::prost::alloc::string::String {
2797        "dydxprotocol.clob.StreamTakerOrder".into()
2798    }
2799    fn type_url() -> ::prost::alloc::string::String {
2800        "/dydxprotocol.clob.StreamTakerOrder".into()
2801    }
2802}
2803/// StreamTakerOrderStatus is a representation of a taker order
2804/// after it is attempted to be matched on the orderbook.
2805/// It is intended to be used only in full node streaming.
2806#[derive(Clone, Copy, PartialEq, ::prost::Message)]
2807pub struct StreamTakerOrderStatus {
2808    /// The state of the taker order after attempting to match it against the
2809    /// orderbook. Possible enum values can be found here:
2810    /// <https://github.com/dydxprotocol/v4-chain/blob/main/protocol/x/clob/types/orderbook.go#L105>
2811    #[prost(uint32, tag = "1")]
2812    pub order_status: u32,
2813    /// The amount of remaining (non-matched) base quantums of this taker order.
2814    #[prost(uint64, tag = "2")]
2815    pub remaining_quantums: u64,
2816    /// The amount of base quantums that were *optimistically* filled for this
2817    /// taker order when the order is matched against the orderbook. Note that if
2818    /// any quantums of this order were optimistically filled or filled in state
2819    /// before this invocation of the matching loop, this value will not include
2820    /// them.
2821    #[prost(uint64, tag = "3")]
2822    pub optimistically_filled_quantums: u64,
2823}
2824impl ::prost::Name for StreamTakerOrderStatus {
2825    const NAME: &'static str = "StreamTakerOrderStatus";
2826    const PACKAGE: &'static str = "dydxprotocol.clob";
2827    fn full_name() -> ::prost::alloc::string::String {
2828        "dydxprotocol.clob.StreamTakerOrderStatus".into()
2829    }
2830    fn type_url() -> ::prost::alloc::string::String {
2831        "/dydxprotocol.clob.StreamTakerOrderStatus".into()
2832    }
2833}
2834/// Generated client implementations.
2835pub mod query_client {
2836    #![allow(
2837        unused_variables,
2838        dead_code,
2839        missing_docs,
2840        clippy::wildcard_imports,
2841        clippy::let_unit_value,
2842    )]
2843    use tonic::codegen::*;
2844    use tonic::codegen::http::Uri;
2845    /// Query defines the gRPC querier service.
2846    #[derive(Debug, Clone)]
2847    pub struct QueryClient<T> {
2848        inner: tonic::client::Grpc<T>,
2849    }
2850    #[cfg(feature = "grpc-transport")]
2851    impl QueryClient<tonic::transport::Channel> {
2852        /// Attempt to create a new client by connecting to a given endpoint.
2853        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
2854        where
2855            D: TryInto<tonic::transport::Endpoint>,
2856            D::Error: Into<StdError>,
2857        {
2858            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
2859            Ok(Self::new(conn))
2860        }
2861    }
2862    impl<T> QueryClient<T>
2863    where
2864        T: tonic::client::GrpcService<tonic::body::Body>,
2865        T::Error: Into<StdError>,
2866        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
2867        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
2868    {
2869        pub fn new(inner: T) -> Self {
2870            let inner = tonic::client::Grpc::new(inner);
2871            Self { inner }
2872        }
2873        pub fn with_origin(inner: T, origin: Uri) -> Self {
2874            let inner = tonic::client::Grpc::with_origin(inner, origin);
2875            Self { inner }
2876        }
2877        pub fn with_interceptor<F>(
2878            inner: T,
2879            interceptor: F,
2880        ) -> QueryClient<InterceptedService<T, F>>
2881        where
2882            F: tonic::service::Interceptor,
2883            T::ResponseBody: Default,
2884            T: tonic::codegen::Service<
2885                http::Request<tonic::body::Body>,
2886                Response = http::Response<
2887                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
2888                >,
2889            >,
2890            <T as tonic::codegen::Service<
2891                http::Request<tonic::body::Body>,
2892            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
2893        {
2894            QueryClient::new(InterceptedService::new(inner, interceptor))
2895        }
2896        /// Compress requests with the given encoding.
2897        ///
2898        /// This requires the server to support it otherwise it might respond with an
2899        /// error.
2900        #[must_use]
2901        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2902            self.inner = self.inner.send_compressed(encoding);
2903            self
2904        }
2905        /// Enable decompressing responses.
2906        #[must_use]
2907        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2908            self.inner = self.inner.accept_compressed(encoding);
2909            self
2910        }
2911        /// Limits the maximum size of a decoded message.
2912        ///
2913        /// Default: `4MB`
2914        #[must_use]
2915        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2916            self.inner = self.inner.max_decoding_message_size(limit);
2917            self
2918        }
2919        /// Limits the maximum size of an encoded message.
2920        ///
2921        /// Default: `usize::MAX`
2922        #[must_use]
2923        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2924            self.inner = self.inner.max_encoding_message_size(limit);
2925            self
2926        }
2927        /// Queries a ClobPair by id.
2928        pub async fn clob_pair(
2929            &mut self,
2930            request: impl tonic::IntoRequest<super::QueryGetClobPairRequest>,
2931        ) -> std::result::Result<
2932            tonic::Response<super::QueryClobPairResponse>,
2933            tonic::Status,
2934        > {
2935            self.inner
2936                .ready()
2937                .await
2938                .map_err(|e| {
2939                    tonic::Status::unknown(
2940                        format!("Service was not ready: {}", e.into()),
2941                    )
2942                })?;
2943            let codec = tonic::codec::ProstCodec::default();
2944            let path = http::uri::PathAndQuery::from_static(
2945                "/dydxprotocol.clob.Query/ClobPair",
2946            );
2947            let mut req = request.into_request();
2948            req.extensions_mut()
2949                .insert(GrpcMethod::new("dydxprotocol.clob.Query", "ClobPair"));
2950            self.inner.unary(req, path, codec).await
2951        }
2952        /// Queries a list of ClobPair items.
2953        pub async fn clob_pair_all(
2954            &mut self,
2955            request: impl tonic::IntoRequest<super::QueryAllClobPairRequest>,
2956        ) -> std::result::Result<
2957            tonic::Response<super::QueryClobPairAllResponse>,
2958            tonic::Status,
2959        > {
2960            self.inner
2961                .ready()
2962                .await
2963                .map_err(|e| {
2964                    tonic::Status::unknown(
2965                        format!("Service was not ready: {}", e.into()),
2966                    )
2967                })?;
2968            let codec = tonic::codec::ProstCodec::default();
2969            let path = http::uri::PathAndQuery::from_static(
2970                "/dydxprotocol.clob.Query/ClobPairAll",
2971            );
2972            let mut req = request.into_request();
2973            req.extensions_mut()
2974                .insert(GrpcMethod::new("dydxprotocol.clob.Query", "ClobPairAll"));
2975            self.inner.unary(req, path, codec).await
2976        }
2977        /// Runs the MEV node <> node calculation with the provided parameters.
2978        pub async fn mev_node_to_node_calculation(
2979            &mut self,
2980            request: impl tonic::IntoRequest<super::MevNodeToNodeCalculationRequest>,
2981        ) -> std::result::Result<
2982            tonic::Response<super::MevNodeToNodeCalculationResponse>,
2983            tonic::Status,
2984        > {
2985            self.inner
2986                .ready()
2987                .await
2988                .map_err(|e| {
2989                    tonic::Status::unknown(
2990                        format!("Service was not ready: {}", e.into()),
2991                    )
2992                })?;
2993            let codec = tonic::codec::ProstCodec::default();
2994            let path = http::uri::PathAndQuery::from_static(
2995                "/dydxprotocol.clob.Query/MevNodeToNodeCalculation",
2996            );
2997            let mut req = request.into_request();
2998            req.extensions_mut()
2999                .insert(
3000                    GrpcMethod::new(
3001                        "dydxprotocol.clob.Query",
3002                        "MevNodeToNodeCalculation",
3003                    ),
3004                );
3005            self.inner.unary(req, path, codec).await
3006        }
3007        /// Queries EquityTierLimitConfiguration.
3008        pub async fn equity_tier_limit_configuration(
3009            &mut self,
3010            request: impl tonic::IntoRequest<
3011                super::QueryEquityTierLimitConfigurationRequest,
3012            >,
3013        ) -> std::result::Result<
3014            tonic::Response<super::QueryEquityTierLimitConfigurationResponse>,
3015            tonic::Status,
3016        > {
3017            self.inner
3018                .ready()
3019                .await
3020                .map_err(|e| {
3021                    tonic::Status::unknown(
3022                        format!("Service was not ready: {}", e.into()),
3023                    )
3024                })?;
3025            let codec = tonic::codec::ProstCodec::default();
3026            let path = http::uri::PathAndQuery::from_static(
3027                "/dydxprotocol.clob.Query/EquityTierLimitConfiguration",
3028            );
3029            let mut req = request.into_request();
3030            req.extensions_mut()
3031                .insert(
3032                    GrpcMethod::new(
3033                        "dydxprotocol.clob.Query",
3034                        "EquityTierLimitConfiguration",
3035                    ),
3036                );
3037            self.inner.unary(req, path, codec).await
3038        }
3039        /// Queries BlockRateLimitConfiguration.
3040        pub async fn block_rate_limit_configuration(
3041            &mut self,
3042            request: impl tonic::IntoRequest<
3043                super::QueryBlockRateLimitConfigurationRequest,
3044            >,
3045        ) -> std::result::Result<
3046            tonic::Response<super::QueryBlockRateLimitConfigurationResponse>,
3047            tonic::Status,
3048        > {
3049            self.inner
3050                .ready()
3051                .await
3052                .map_err(|e| {
3053                    tonic::Status::unknown(
3054                        format!("Service was not ready: {}", e.into()),
3055                    )
3056                })?;
3057            let codec = tonic::codec::ProstCodec::default();
3058            let path = http::uri::PathAndQuery::from_static(
3059                "/dydxprotocol.clob.Query/BlockRateLimitConfiguration",
3060            );
3061            let mut req = request.into_request();
3062            req.extensions_mut()
3063                .insert(
3064                    GrpcMethod::new(
3065                        "dydxprotocol.clob.Query",
3066                        "BlockRateLimitConfiguration",
3067                    ),
3068                );
3069            self.inner.unary(req, path, codec).await
3070        }
3071        /// Queries LiquidationsConfiguration.
3072        pub async fn liquidations_configuration(
3073            &mut self,
3074            request: impl tonic::IntoRequest<
3075                super::QueryLiquidationsConfigurationRequest,
3076            >,
3077        ) -> std::result::Result<
3078            tonic::Response<super::QueryLiquidationsConfigurationResponse>,
3079            tonic::Status,
3080        > {
3081            self.inner
3082                .ready()
3083                .await
3084                .map_err(|e| {
3085                    tonic::Status::unknown(
3086                        format!("Service was not ready: {}", e.into()),
3087                    )
3088                })?;
3089            let codec = tonic::codec::ProstCodec::default();
3090            let path = http::uri::PathAndQuery::from_static(
3091                "/dydxprotocol.clob.Query/LiquidationsConfiguration",
3092            );
3093            let mut req = request.into_request();
3094            req.extensions_mut()
3095                .insert(
3096                    GrpcMethod::new(
3097                        "dydxprotocol.clob.Query",
3098                        "LiquidationsConfiguration",
3099                    ),
3100                );
3101            self.inner.unary(req, path, codec).await
3102        }
3103        /// Queries the stateful order for a given order id.
3104        pub async fn stateful_order(
3105            &mut self,
3106            request: impl tonic::IntoRequest<super::QueryStatefulOrderRequest>,
3107        ) -> std::result::Result<
3108            tonic::Response<super::QueryStatefulOrderResponse>,
3109            tonic::Status,
3110        > {
3111            self.inner
3112                .ready()
3113                .await
3114                .map_err(|e| {
3115                    tonic::Status::unknown(
3116                        format!("Service was not ready: {}", e.into()),
3117                    )
3118                })?;
3119            let codec = tonic::codec::ProstCodec::default();
3120            let path = http::uri::PathAndQuery::from_static(
3121                "/dydxprotocol.clob.Query/StatefulOrder",
3122            );
3123            let mut req = request.into_request();
3124            req.extensions_mut()
3125                .insert(GrpcMethod::new("dydxprotocol.clob.Query", "StatefulOrder"));
3126            self.inner.unary(req, path, codec).await
3127        }
3128        /// Queries the next clob pair id.
3129        pub async fn next_clob_pair_id(
3130            &mut self,
3131            request: impl tonic::IntoRequest<super::QueryNextClobPairIdRequest>,
3132        ) -> std::result::Result<
3133            tonic::Response<super::QueryNextClobPairIdResponse>,
3134            tonic::Status,
3135        > {
3136            self.inner
3137                .ready()
3138                .await
3139                .map_err(|e| {
3140                    tonic::Status::unknown(
3141                        format!("Service was not ready: {}", e.into()),
3142                    )
3143                })?;
3144            let codec = tonic::codec::ProstCodec::default();
3145            let path = http::uri::PathAndQuery::from_static(
3146                "/dydxprotocol.clob.Query/NextClobPairId",
3147            );
3148            let mut req = request.into_request();
3149            req.extensions_mut()
3150                .insert(GrpcMethod::new("dydxprotocol.clob.Query", "NextClobPairId"));
3151            self.inner.unary(req, path, codec).await
3152        }
3153        /// Streams orderbook updates. Updates contain orderbook data
3154        /// such as order placements, updates, and fills.
3155        pub async fn stream_orderbook_updates(
3156            &mut self,
3157            request: impl tonic::IntoRequest<super::StreamOrderbookUpdatesRequest>,
3158        ) -> std::result::Result<
3159            tonic::Response<
3160                tonic::codec::Streaming<super::StreamOrderbookUpdatesResponse>,
3161            >,
3162            tonic::Status,
3163        > {
3164            self.inner
3165                .ready()
3166                .await
3167                .map_err(|e| {
3168                    tonic::Status::unknown(
3169                        format!("Service was not ready: {}", e.into()),
3170                    )
3171                })?;
3172            let codec = tonic::codec::ProstCodec::default();
3173            let path = http::uri::PathAndQuery::from_static(
3174                "/dydxprotocol.clob.Query/StreamOrderbookUpdates",
3175            );
3176            let mut req = request.into_request();
3177            req.extensions_mut()
3178                .insert(
3179                    GrpcMethod::new("dydxprotocol.clob.Query", "StreamOrderbookUpdates"),
3180                );
3181            self.inner.server_streaming(req, path, codec).await
3182        }
3183    }
3184}
3185/// StagedFinalizeBlockEvent is an event staged during `FinalizeBlock`.
3186#[derive(Clone, PartialEq, ::prost::Message)]
3187pub struct StagedFinalizeBlockEvent {
3188    /// Contains one of StreamOrderbookFill, StreamSubaccountUpdate.
3189    #[prost(oneof = "staged_finalize_block_event::Event", tags = "1, 2, 3, 4")]
3190    pub event: ::core::option::Option<staged_finalize_block_event::Event>,
3191}
3192/// Nested message and enum types in `StagedFinalizeBlockEvent`.
3193pub mod staged_finalize_block_event {
3194    /// Contains one of StreamOrderbookFill, StreamSubaccountUpdate.
3195    #[derive(Clone, PartialEq, ::prost::Oneof)]
3196    pub enum Event {
3197        #[prost(message, tag = "1")]
3198        OrderFill(super::StreamOrderbookFill),
3199        #[prost(message, tag = "2")]
3200        SubaccountUpdate(super::super::subaccounts::StreamSubaccountUpdate),
3201        #[prost(message, tag = "3")]
3202        OrderbookUpdate(super::StreamOrderbookUpdate),
3203        #[prost(message, tag = "4")]
3204        PriceUpdate(super::super::prices::StreamPriceUpdate),
3205    }
3206}
3207impl ::prost::Name for StagedFinalizeBlockEvent {
3208    const NAME: &'static str = "StagedFinalizeBlockEvent";
3209    const PACKAGE: &'static str = "dydxprotocol.clob";
3210    fn full_name() -> ::prost::alloc::string::String {
3211        "dydxprotocol.clob.StagedFinalizeBlockEvent".into()
3212    }
3213    fn type_url() -> ::prost::alloc::string::String {
3214        "/dydxprotocol.clob.StagedFinalizeBlockEvent".into()
3215    }
3216}