pub struct NewOrderRequest {Show 16 fields
pub instrument_name: String,
pub amount: f64,
pub order_type: OrderType,
pub side: OrderSide,
pub price: Option<f64>,
pub time_in_force: TimeInForce,
pub post_only: Option<bool>,
pub reduce_only: Option<bool>,
pub label: Option<String>,
pub stop_price: Option<f64>,
pub trigger: Option<TriggerType>,
pub advanced: Option<AdvancedOrderType>,
pub max_show: Option<f64>,
pub reject_post_only: Option<bool>,
pub valid_until: Option<i64>,
pub client_order_id: Option<String>,
}Expand description
Generic request for creating new orders (API style)
This structure represents an order request in the API format used by deribit-base. It contains all parameters needed to place a new order.
Fields§
§instrument_name: StringInstrument name (e.g., “BTC-PERPETUAL”)
amount: f64Order amount
order_type: OrderTypeOrder type
side: OrderSideOrder side (buy/sell)
price: Option<f64>Order price (required for limit orders)
time_in_force: TimeInForceTime in force
post_only: Option<bool>Post-only flag
reduce_only: Option<bool>Reduce-only flag
label: Option<String>Order label
stop_price: Option<f64>Stop price for stop orders
trigger: Option<TriggerType>Trigger type for stop orders
advanced: Option<AdvancedOrderType>Advanced order type
max_show: Option<f64>Maximum show amount (iceberg orders)
reject_post_only: Option<bool>Reject post-only flag
valid_until: Option<i64>Valid until timestamp
client_order_id: Option<String>Client order ID for tracking
Implementations§
Source§impl NewOrderRequest
impl NewOrderRequest
Sourcepub fn market_buy(instrument_name: String, amount: f64) -> Self
pub fn market_buy(instrument_name: String, amount: f64) -> Self
Create a new market buy order
Sourcepub fn market_sell(instrument_name: String, amount: f64) -> Self
pub fn market_sell(instrument_name: String, amount: f64) -> Self
Create a new market sell order
Sourcepub fn limit_buy(instrument_name: String, amount: f64, price: f64) -> Self
pub fn limit_buy(instrument_name: String, amount: f64, price: f64) -> Self
Create a new limit buy order
Sourcepub fn limit_sell(instrument_name: String, amount: f64, price: f64) -> Self
pub fn limit_sell(instrument_name: String, amount: f64, price: f64) -> Self
Create a new limit sell order
Sourcepub fn with_post_only(self, post_only: bool) -> Self
pub fn with_post_only(self, post_only: bool) -> Self
Set the order as post-only
Sourcepub fn with_reduce_only(self, reduce_only: bool) -> Self
pub fn with_reduce_only(self, reduce_only: bool) -> Self
Set the order as reduce-only
Sourcepub fn with_label(self, label: String) -> Self
pub fn with_label(self, label: String) -> Self
Set order label
Sourcepub fn with_time_in_force(self, tif: TimeInForce) -> Self
pub fn with_time_in_force(self, tif: TimeInForce) -> Self
Set time in force
Sourcepub fn with_client_order_id(self, client_order_id: String) -> Self
pub fn with_client_order_id(self, client_order_id: String) -> Self
Set client order ID
Trait Implementations§
Source§impl Clone for NewOrderRequest
impl Clone for NewOrderRequest
Source§fn clone(&self) -> NewOrderRequest
fn clone(&self) -> NewOrderRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NewOrderRequest
impl Debug for NewOrderRequest
Source§impl<'de> Deserialize<'de> for NewOrderRequest
impl<'de> Deserialize<'de> for NewOrderRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for NewOrderRequest
impl Display for NewOrderRequest
Auto Trait Implementations§
impl Freeze for NewOrderRequest
impl RefUnwindSafe for NewOrderRequest
impl Send for NewOrderRequest
impl Sync for NewOrderRequest
impl Unpin for NewOrderRequest
impl UnsafeUnpin for NewOrderRequest
impl UnwindSafe for NewOrderRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.