pub struct DerivePosition {Show 22 fields
pub amount: Decimal,
pub average_price: Decimal,
pub creation_timestamp: i64,
pub cumulative_funding: Decimal,
pub delta: Decimal,
pub gamma: Decimal,
pub index_price: Decimal,
pub initial_margin: Decimal,
pub instrument_name: Ustr,
pub instrument_type: DeriveInstrumentType,
pub leverage: Option<Decimal>,
pub liquidation_price: Option<Decimal>,
pub maintenance_margin: Decimal,
pub mark_price: Decimal,
pub mark_value: Decimal,
pub net_settlements: Decimal,
pub open_orders_margin: Decimal,
pub pending_funding: Decimal,
pub realized_pnl: Decimal,
pub theta: Decimal,
pub unrealized_pnl: Decimal,
pub vega: Decimal,
}Expand description
Position record returned by private/get_positions and embedded in
private/get_subaccount responses.
Fields§
§amount: DecimalSigned position amount; positive = long, negative = short.
average_price: DecimalAverage entry price over the lifetime of the position.
creation_timestamp: i64Position opening timestamp (UNIX ms).
cumulative_funding: DecimalCumulative funding accrued by this position (perps only).
delta: DecimalPosition delta (with respect to forward for options).
gamma: DecimalPosition gamma (zero for non-options).
index_price: DecimalCurrent oracle index price for the underlying.
initial_margin: DecimalUSD initial margin requirement for this position.
instrument_name: UstrInstrument identifier (same as the base asset name).
instrument_type: DeriveInstrumentTypeInstrument category.
leverage: Option<Decimal>Effective leverage (perps only).
liquidation_price: Option<Decimal>Index price at which the position would liquidate.
maintenance_margin: DecimalUSD maintenance margin requirement.
mark_price: DecimalCurrent mark price.
mark_value: DecimalUSD mark-to-market value of the position.
net_settlements: DecimalNet USD settled from this position.
open_orders_margin: DecimalUSD margin held against open orders touching this asset.
pending_funding: DecimalFunding not yet settled into cash balance (perps only).
realized_pnl: DecimalRealized PnL booked on this position.
theta: DecimalPosition theta (zero for non-options).
unrealized_pnl: DecimalUnrealized PnL.
vega: DecimalPosition vega (zero for non-options).
Trait Implementations§
Source§impl Clone for DerivePosition
impl Clone for DerivePosition
Source§fn clone(&self) -> DerivePosition
fn clone(&self) -> DerivePosition
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DerivePosition
impl Debug for DerivePosition
Source§impl<'de> Deserialize<'de> for DerivePosition
impl<'de> Deserialize<'de> for DerivePosition
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>,
Auto Trait Implementations§
impl Freeze for DerivePosition
impl RefUnwindSafe for DerivePosition
impl Send for DerivePosition
impl Sync for DerivePosition
impl Unpin for DerivePosition
impl UnsafeUnpin for DerivePosition
impl UnwindSafe for DerivePosition
Blanket Implementations§
impl<T> Allocation for T
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
impl<'de, T> BorrowedRpcObject<'de> for Twhere
T: RpcBorrow<'de> + RpcSend,
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more