pub struct OrderRequest {Show 14 fields
pub instrument_name: String,
pub amount: f64,
pub order_type: Option<OrderType>,
pub label: Option<String>,
pub price: Option<f64>,
pub time_in_force: Option<TimeInForce>,
pub max_show: Option<f64>,
pub post_only: Option<bool>,
pub reduce_only: Option<bool>,
pub trigger_price: Option<f64>,
pub trigger: Option<Trigger>,
pub advanced: Option<String>,
pub mmp: Option<bool>,
pub valid_until: Option<u64>,
}Expand description
Order request parameters for buy/sell operations
Fields§
§instrument_name: StringInstrument name (e.g., “BTC-PERPETUAL”)
amount: f64Order amount (positive number)
order_type: Option<OrderType>Order type (limit, market, etc.)
label: Option<String>User-defined label for the order (max 64 chars)
price: Option<f64>Limit price for the order
time_in_force: Option<TimeInForce>Time in force specification
max_show: Option<f64>Maximum amount to show in order book (for iceberg orders)
post_only: Option<bool>Whether the order should only be posted (not taken)
reduce_only: Option<bool>Whether this order only reduces position
trigger_price: Option<f64>Trigger price for conditional orders
trigger: Option<Trigger>Trigger type for conditional orders
advanced: Option<String>Advanced order type (usd or implv)
mmp: Option<bool>Market maker protection flag
valid_until: Option<u64>Order validity timestamp (Unix timestamp in milliseconds)
Implementations§
Source§impl OrderRequest
impl OrderRequest
Sourcepub fn limit(instrument_name: String, amount: f64, price: f64) -> Self
pub fn limit(instrument_name: String, amount: f64, price: f64) -> Self
Create a new limit order request
Sourcepub fn with_label(self, label: String) -> Self
pub fn with_label(self, label: String) -> Self
Set the 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_post_only(self, post_only: bool) -> Self
pub fn with_post_only(self, post_only: bool) -> Self
Set post-only flag
Sourcepub fn with_reduce_only(self, reduce_only: bool) -> Self
pub fn with_reduce_only(self, reduce_only: bool) -> Self
Set reduce-only flag
Sourcepub fn with_max_show(self, max_show: f64) -> Self
pub fn with_max_show(self, max_show: f64) -> Self
Set max show amount for iceberg orders
Sourcepub fn with_trigger(self, trigger_price: f64, trigger: Trigger) -> Self
pub fn with_trigger(self, trigger_price: f64, trigger: Trigger) -> Self
Set trigger price for conditional orders
Trait Implementations§
Source§impl Clone for OrderRequest
impl Clone for OrderRequest
Source§fn clone(&self) -> OrderRequest
fn clone(&self) -> OrderRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more