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