pub struct Position {Show 26 fields
pub instrument_name: String,
pub size: f64,
pub direction: Direction,
pub average_price: f64,
pub average_price_usd: Option<f64>,
pub delta: Option<f64>,
pub estimated_liquidation_price: Option<f64>,
pub floating_profit_loss: Option<f64>,
pub floating_profit_loss_usd: Option<f64>,
pub gamma: Option<f64>,
pub index_price: Option<f64>,
pub initial_margin: Option<f64>,
pub interest_value: Option<f64>,
pub kind: Option<String>,
pub leverage: Option<i32>,
pub maintenance_margin: Option<f64>,
pub mark_price: Option<f64>,
pub open_orders_margin: Option<f64>,
pub realized_funding: Option<f64>,
pub realized_profit_loss: Option<f64>,
pub settlement_price: Option<f64>,
pub size_currency: Option<f64>,
pub theta: Option<f64>,
pub total_profit_loss: Option<f64>,
pub vega: Option<f64>,
pub unrealized_profit_loss: Option<f64>,
}Expand description
Trading position structure
Represents a trading position with all associated metrics including size, direction, prices, margins, and Greeks for options.
Fields§
§instrument_name: StringName of the instrument (e.g., “BTC-PERPETUAL”)
size: f64Position size (positive for long, negative for short)
direction: DirectionDirection of the position (buy/sell)
average_price: f64Average entry price of the position
average_price_usd: Option<f64>Average price in USD
delta: Option<f64>Delta (price sensitivity) of the position
estimated_liquidation_price: Option<f64>Estimated liquidation price
floating_profit_loss: Option<f64>Floating (unrealized) profit/loss
floating_profit_loss_usd: Option<f64>Floating profit/loss in USD
gamma: Option<f64>Gamma (delta sensitivity) of the position
index_price: Option<f64>Current index price
initial_margin: Option<f64>Initial margin requirement
interest_value: Option<f64>Interest value
kind: Option<String>Instrument kind (future, option, etc.)
leverage: Option<i32>Leverage used for the position
maintenance_margin: Option<f64>Maintenance margin requirement
mark_price: Option<f64>Current mark price
open_orders_margin: Option<f64>Margin used by open orders
realized_funding: Option<f64>Realized funding payments
realized_profit_loss: Option<f64>Realized profit/loss
settlement_price: Option<f64>Settlement price
size_currency: Option<f64>Position size in currency units
theta: Option<f64>Theta (time decay) of the position
total_profit_loss: Option<f64>Total profit/loss
vega: Option<f64>Vega (volatility sensitivity) of the position
unrealized_profit_loss: Option<f64>Unrealized profit/loss