pub struct Position {Show 15 fields
pub id: String,
pub symbol: String,
pub side: PositionSide,
pub size: Decimal,
pub entry_price: Decimal,
pub mark_price: Decimal,
pub unrealized_pnl: Decimal,
pub realized_pnl: Decimal,
pub margin: Decimal,
pub leverage: Decimal,
pub liquidation_price: Option<Decimal>,
pub take_profit: Option<Decimal>,
pub stop_loss: Option<Decimal>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Expand description
Trading position
Fields§
§id: StringUnique position ID
symbol: StringTrading pair symbol
side: PositionSidePosition side (Long/Short)
size: DecimalPosition size
entry_price: DecimalAverage entry price
mark_price: DecimalCurrent mark price
unrealized_pnl: DecimalUnrealized PnL
realized_pnl: DecimalRealized PnL
margin: DecimalMargin used
leverage: DecimalLeverage
liquidation_price: Option<Decimal>Liquidation price
take_profit: Option<Decimal>Take profit price
stop_loss: Option<Decimal>Stop loss price
created_at: DateTime<Utc>Position creation timestamp
updated_at: DateTime<Utc>Last update timestamp
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Position
impl<'de> Deserialize<'de> for Position
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>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Position
Auto Trait Implementations§
impl Freeze for Position
impl RefUnwindSafe for Position
impl Send for Position
impl Sync for Position
impl Unpin for Position
impl UnwindSafe for Position
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
Mutably borrows from an owned value. Read more
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> 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> 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>
Converts
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>
Converts
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