#[non_exhaustive]pub struct BalanceAndPositionUpdate {
pub p_time: NumberString,
pub event_type: String,
pub bal_data: Vec<BalData>,
pub pos_data: Vec<PosData>,
pub trades: Vec<Trade>,
pub extra: ExtraFields,
}Expand description
A data row pushed by the private balance_and_position WebSocket channel.
This channel provides near-real-time updates for account cash balances and positions. Updates may be triggered by events such as:
- order fills;
- funding transfers;
- delivery or exercise;
- liquidation or ADL;
- funding-fee deductions;
- margin or leverage adjustments.
A push may contain only BalanceAndPositionUpdate::bal_data when only a
balance changes, or only BalanceAndPositionUpdate::pos_data when only a
position changes.
During the initial snapshot, OKX only pushes:
- currencies whose cash balance is non-zero;
- positions whose quantity is non-zero.
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.p_time: NumberStringPush time of the balance and position information.
Unix timestamp in milliseconds, for example 1597026383085.
event_type: StringEvent that caused this update.
- Typical values include:
delivered,exercised,transferred,filled,liquidationclaw_back,adl,funding_fee,adjust_margin,set_leverageinterest_deduction,settlement
bal_data: Vec<BalData>Updated account cash-balance records.
This array may be empty when the push only contains position changes.
pos_data: Vec<PosData>Updated position records.
This array may be empty when the push only contains balance changes.
trades: Vec<Trade>Trades associated with the balance or position update.
extra: ExtraFieldsAdditional fields added by OKX that are not yet represented explicitly.
Trait Implementations§
Source§impl Clone for BalanceAndPositionUpdate
impl Clone for BalanceAndPositionUpdate
Source§fn clone(&self) -> BalanceAndPositionUpdate
fn clone(&self) -> BalanceAndPositionUpdate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more