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: UstrInstrument ID.
inst_type: OKXInstrumentTypeInstrument type.
mgn_mode: OKXMarginModeMargin mode: isolated/cross.
pos_id: Option<Ustr>Position ID.
pos_side: OKXPositionSidePosition side: long/short.
pos: StringPosition size.
base_bal: StringBase currency balance.
ccy: StringPosition currency.
fee: StringTrading fee.
lever: StringPosition leverage.
last: StringLast traded price.
mark_px: StringMark price.
liq_px: StringLiquidation price.
mmr: StringMaintenance margin requirement.
interest: StringInterest.
trade_id: UstrTrade ID.
notional_usd: StringNotional value of position in USD.
avg_px: StringAverage entry price.
upl: StringUnrealized profit and loss.
upl_ratio: StringUnrealized profit and loss ratio.
u_time: u64Last update time, Unix timestamp in milliseconds.
margin: StringPosition margin.
mgn_ratio: StringMargin ratio.
adl: StringAuto-deleveraging (ADL) ranking.
c_time: StringCreation time, Unix timestamp in milliseconds.
realized_pnl: StringRealized profit and loss.
upl_last_px: StringUnrealized profit and loss at last price.
upl_ratio_last_px: StringUnrealized profit and loss ratio at last price.
avail_pos: StringAvailable position that can be closed.
be_px: StringBreakeven price.
funding_fee: StringFunding fee.
idx_px: StringIndex price.
liq_penalty: StringLiquidation penalty.
opt_val: StringOption value.
pending_close_ord_liab_val: StringPending close order liability value.
pnl: StringTotal profit and loss.
pos_ccy: StringPosition currency.
quote_bal: StringQuote currency balance.
quote_borrowed: StringBorrowed amount in quote currency.
quote_interest: StringInterest on quote currency.
spot_in_use_amt: StringAmount in use for spot trading.
spot_in_use_ccy: StringCurrency in use for spot trading.
usd_px: StringUSD 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 UnsafeUnpin 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