Skip to main content

bybit/models/
request_type.rs

1use crate::prelude::*;
2
3/// Enum representing different types of batch order requests.
4///
5/// This enum allows bots to specify whether a batch request is for creating, amending, or canceling orders.
6/// It provides flexibility for handling multiple order operations in a unified way.
7#[derive(Clone)]
8pub enum RequestType<'a> {
9    /// A batch order creation request.
10    ///
11    /// Used to place multiple new orders. Bots use this for strategies requiring simultaneous order placements,
12    /// such as grid trading or scalping.
13    Create(OrderRequest<'a>),
14
15    /// A batch order creation request for multiple orders.
16    ///
17    /// Used to place multiple new orders in a single request. Bots use this for strategies requiring simultaneous order placements,
18    /// such as grid trading or scalping.
19    CreateBatch(BatchPlaceRequest<'a>),
20
21    /// A batch order amendment request.
22    ///
23    /// Used to modify multiple existing orders. Bots use this to adjust order parameters in response to market changes,
24    /// such as adjusting stop-losses or take-profits.
25    Amend(AmendOrderRequest<'a>),
26
27    /// A batch order amendment request for multiple orders.
28    ///
29    /// Used to modify multiple existing orders in a single request. Bots use this to adjust order parameters in response to market changes,
30    /// such as adjusting stop-losses or take-profits.
31    AmendBatch(BatchAmendRequest<'a>),
32
33    /// A batch order cancellation request.
34    ///
35    /// Used to cancel multiple existing orders. Bots use this for risk management or strategy adjustments,
36    /// such as canceling orders when a position is closed or when a strategy is changed.
37    Cancel(CancelOrderRequest<'a>),
38
39    /// A batch order cancellation request for multiple orders.
40    ///
41    /// Used to cancel multiple existing orders in a single request. Bots use this for risk management or strategy adjustments,
42    /// such as canceling orders when a position is closed or when a strategy is changed.
43    CancelBatch(BatchCancelRequest<'a>),
44}