#[non_exhaustive]pub struct PosData {Show 14 fields
pub pos_id: String,
pub trade_id: String,
pub inst_id: String,
pub inst_type: String,
pub mgn_mode: String,
pub pos_side: String,
pub pos: NumberString,
pub ccy: String,
pub pos_ccy: String,
pub avg_px: NumberString,
pub non_settle_avg_px: String,
pub settled_pnl: String,
pub u_time: NumberString,
pub extra: ExtraFields,
}Expand description
A position record from the posData array.
OKX docs: https://www.okx.com/docs-v5/en/#trading-account-websocket-balance-and-position-channel
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.pos_id: StringPosition ID assigned by OKX.
trade_id: StringID of the latest trade associated with the position.
Trade IDs should be treated as opaque identifiers rather than numeric values.
inst_id: StringInstrument ID, for example BTC-USDT-SWAP.
inst_type: StringInstrument type.
Typical values include:
MARGIN;SWAP;FUTURES;OPTION.
mgn_mode: StringMargin mode.
Possible values:
cross;isolated.
pos_side: StringPosition side.
Possible values:
long: long side in long/short mode;short: short side in long/short mode;net: net position mode.
pos: NumberStringPosition quantity.
For derivatives, the unit is normally the number of contracts.
In isolated margin mode, OKX may push a position whose quantity is 0
after a manual margin transfer.
ccy: StringCurrency used for margin.
pos_ccy: StringPosition currency.
Only applicable to MARGIN positions.
avg_px: NumberStringAverage entry price of the position.
non_settle_avg_px: StringNon-settlement entry price.
This value only reflects the average price at which the position was opened or increased.
Only applicable to cross-margin FUTURES positions.
settled_pnl: StringAccumulated settled profit and loss calculated using settlement prices.
Only applicable to cross-margin FUTURES positions.
u_time: NumberStringTime when the position was last updated.
Unix timestamp in milliseconds, for example 1597026383085.
extra: ExtraFieldsAdditional fields added by OKX that are not yet represented explicitly.