pub struct OKXPosition {Show 43 fields
pub inst_id: Ustr,
pub inst_type: OKXInstrumentType,
pub mgn_mode: OKXMarginMode,
pub pos_id: Option<Ustr>,
pub pos_side: OKXPositionSide,
pub pos: String,
pub base_bal: String,
pub ccy: String,
pub fee: String,
pub lever: String,
pub last: String,
pub mark_px: String,
pub liq_px: String,
pub mmr: String,
pub interest: String,
pub trade_id: Ustr,
pub notional_usd: String,
pub avg_px: String,
pub upl: String,
pub upl_ratio: String,
pub u_time: u64,
pub margin: String,
pub mgn_ratio: String,
pub adl: String,
pub c_time: String,
pub realized_pnl: String,
pub upl_last_px: String,
pub upl_ratio_last_px: String,
pub avail_pos: String,
pub be_px: String,
pub funding_fee: String,
pub idx_px: String,
pub liq_penalty: String,
pub opt_val: String,
pub pending_close_ord_liab_val: String,
pub pnl: String,
pub pos_ccy: String,
pub quote_bal: String,
pub quote_borrowed: String,
pub quote_interest: String,
pub spot_in_use_amt: String,
pub spot_in_use_ccy: String,
pub usd_px: String,
}
Expand description
Represents a single open position from GET /api/v5/account/positions
.
Fields§
§inst_id: Ustr
Instrument ID.
inst_type: OKXInstrumentType
Instrument type.
mgn_mode: OKXMarginMode
Margin mode: isolated/cross.
pos_id: Option<Ustr>
Position ID.
pos_side: OKXPositionSide
Position side: long/short.
pos: String
Position size.
base_bal: String
Base currency balance.
ccy: String
Position currency.
fee: String
Trading fee.
lever: String
Position leverage.
last: String
Last traded price.
mark_px: String
Mark price.
liq_px: String
Liquidation price.
mmr: String
Maintenance margin requirement.
interest: String
Interest.
trade_id: Ustr
Trade ID.
notional_usd: String
Notional value of position in USD.
avg_px: String
Average entry price.
upl: String
Unrealized profit and loss.
upl_ratio: String
Unrealized profit and loss ratio.
u_time: u64
Last update time, Unix timestamp in milliseconds.
margin: String
Position margin.
mgn_ratio: String
Margin ratio.
adl: String
Auto-deleveraging (ADL) ranking.
c_time: String
Creation time, Unix timestamp in milliseconds.
realized_pnl: String
Realized profit and loss.
upl_last_px: String
Unrealized profit and loss at last price.
upl_ratio_last_px: String
Unrealized profit and loss ratio at last price.
avail_pos: String
Available position that can be closed.
be_px: String
Breakeven price.
funding_fee: String
Funding fee.
idx_px: String
Index price.
liq_penalty: String
Liquidation penalty.
opt_val: String
Option value.
pending_close_ord_liab_val: String
Pending close order liability value.
pnl: String
Total profit and loss.
pos_ccy: String
Position currency.
quote_bal: String
Quote currency balance.
quote_borrowed: String
Borrowed amount in quote currency.
quote_interest: String
Interest on quote currency.
spot_in_use_amt: String
Amount in use for spot trading.
spot_in_use_ccy: String
Currency in use for spot trading.
usd_px: String
USD price.
Trait Implementations§
Source§impl Clone for OKXPosition
impl Clone for OKXPosition
Source§fn clone(&self) -> OKXPosition
fn clone(&self) -> OKXPosition
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for OKXPosition
impl Debug for OKXPosition
Source§impl<'de> Deserialize<'de> for OKXPosition
impl<'de> Deserialize<'de> for OKXPosition
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 OKXPosition
impl RefUnwindSafe for OKXPosition
impl Send for OKXPosition
impl Sync for OKXPosition
impl Unpin for OKXPosition
impl UnwindSafe for OKXPosition
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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