#[non_exhaustive]pub struct AccountUpdate {Show 21 fields
pub adj_eq: NumberString,
pub avail_eq: NumberString,
pub borrow_froz: NumberString,
pub delta: NumberString,
pub delta_lever: NumberString,
pub delta_neutral_status: String,
pub details: Vec<AccountBalanceUpdate>,
pub imr: NumberString,
pub iso_eq: NumberString,
pub mgn_ratio: NumberString,
pub mmr: NumberString,
pub notional_usd: NumberString,
pub notional_usd_for_borrow: NumberString,
pub notional_usd_for_futures: NumberString,
pub notional_usd_for_option: NumberString,
pub notional_usd_for_swap: NumberString,
pub ord_froz: NumberString,
pub total_eq: NumberString,
pub u_time: NumberString,
pub upl: NumberString,
pub extra: ExtraFields,
}Expand description
Account data row pushed by the private account WebSocket channel.
The account channel provides account-level equity, margin requirements, liabilities, notional values, risk indicators, and detailed per-currency balances.
OKX may push account information:
- after account-related events, such as order placement, cancellation or execution;
- at regular intervals;
- as an initial paginated snapshot.
Only currencies with a non-zero eq, availEq, or availBal are included
in the initial and regular snapshots.
The outer WebSocket message fields curPage and lastPage
are not part of this structure. They belong to the WebSocket push envelope.
OKX docs: https://www.okx.com/docs-v5/en/#trading-account-websocket-account-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.adj_eq: NumberStringAdjusted or effective account equity denominated in USD.
This is the net value of assets that can provide margin after applying collateral discount rates.
Applicable to Spot mode, Multi-currency margin mode and Portfolio margin mode.
avail_eq: NumberStringAccount-level available equity.
Currencies restricted by the collateralized borrowing limit are excluded.
Applicable to Multi-currency margin mode and Portfolio margin mode.
borrow_froz: NumberStringPotential borrowing initial margin requirement of the account in USD.
An empty string may be returned when the field is not applicable to the current account mode.
delta: NumberStringAccount delta denominated in USD.
delta_lever: NumberStringAccount-level delta leverage for a delta-neutral strategy.
Calculated by OKX as delta / totalEq.
delta_neutral_status: StringDelta-neutral risk status.
Documented values:
"0": normal;"1": transfers are restricted;"2": delta-reducing restrictions are active.
This remains a string so newly introduced OKX status values can still be decoded.
details: Vec<AccountBalanceUpdate>Detailed account information grouped by currency.
imr: NumberStringAccount-level initial margin requirement in USD.
This is the sum of initial margin requirements for cross-margin positions and pending orders.
iso_eq: NumberStringIsolated-margin equity denominated in USD.
Applicable to Futures mode, Multi-currency margin mode and Portfolio margin mode.
mgn_ratio: NumberStringAccount maintenance margin ratio.
Applicable to Spot mode, Multi-currency margin mode and Portfolio margin mode.
mmr: NumberStringAccount-level maintenance margin requirement in USD.
This is the sum of maintenance margin requirements for cross-margin positions and pending orders.
notional_usd: NumberStringTotal notional value of account positions in USD.
notional_usd_for_borrow: NumberStringNotional value attributed to borrowing in USD.
notional_usd_for_futures: NumberStringNotional value of expiry-futures positions in USD.
notional_usd_for_option: NumberStringNotional value of option positions in USD.
notional_usd_for_swap: NumberStringNotional value of perpetual-futures positions in USD.
ord_froz: NumberStringCross-margin amount frozen by pending orders, denominated in USD.
total_eq: NumberStringTotal account equity denominated in USD.
u_time: NumberStringTime when the account information was last updated.
Unix timestamp in milliseconds, for example 1705564223311.
upl: NumberStringAccount-level cross-margin unrealized profit and loss in USD.
Applicable to Multi-currency margin mode and Portfolio margin mode.
extra: ExtraFieldsAdditional account fields introduced by OKX that are not yet represented explicitly.
Trait Implementations§
Source§impl Clone for AccountUpdate
impl Clone for AccountUpdate
Source§fn clone(&self) -> AccountUpdate
fn clone(&self) -> AccountUpdate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more