#[non_exhaustive]pub struct AccountBalanceUpdate {Show 49 fields
pub auto_lend_status: String,
pub auto_lend_mt_amt: NumberString,
pub avail_bal: NumberString,
pub avail_eq: NumberString,
pub borrow_froz: NumberString,
pub cash_bal: NumberString,
pub ccy: String,
pub coin_usd_price: NumberString,
pub cross_liab: NumberString,
pub col_res: String,
pub collateral_enabled: bool,
pub col_borr_auto_conversion: String,
pub dis_eq: NumberString,
pub eq: NumberString,
pub eq_usd: NumberString,
pub smt_sync_eq: NumberString,
pub spot_copy_trading_eq: NumberString,
pub fixed_bal: NumberString,
pub frozen_bal: NumberString,
pub frp_type: String,
pub imr: NumberString,
pub interest: NumberString,
pub iso_eq: NumberString,
pub iso_liab: NumberString,
pub iso_upl: NumberString,
pub liab: NumberString,
pub max_loan: NumberString,
pub mgn_ratio: NumberString,
pub mmr: NumberString,
pub notional_lever: NumberString,
pub ord_frozen: NumberString,
pub reward_bal: NumberString,
pub spot_in_use_amt: NumberString,
pub cl_spot_in_use_amt: NumberString,
pub max_spot_in_use_amt: NumberString,
pub spot_iso_bal: NumberString,
pub stgy_eq: NumberString,
pub twap: NumberString,
pub u_time: NumberString,
pub upl: NumberString,
pub upl_liab: NumberString,
pub spot_bal: NumberString,
pub open_avg_px: NumberString,
pub acc_avg_px: NumberString,
pub spot_upl: NumberString,
pub spot_upl_ratio: NumberString,
pub total_pnl: NumberString,
pub total_pnl_ratio: NumberString,
pub extra: ExtraFields,
}Expand description
Per-currency account data contained in AccountUpdate::details.
Fields that do not apply to the current account mode are commonly returned by OKX as empty strings.
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.auto_lend_status: StringAuto-lending status for this currency.
Documented values:
unsupported: auto lending is unsupported;off: supported but disabled;pending: enabled and waiting for matching;active: enabled and matched.
auto_lend_mt_amt: NumberStringAmount of the currency currently matched for auto lending.
Returns zero when Self::auto_lend_status is unsupported, off,
or pending.
avail_bal: NumberStringAvailable balance of the currency.
avail_eq: NumberStringAvailable equity of the currency.
Applicable to Futures mode, Multi-currency margin mode and Portfolio margin mode.
borrow_froz: NumberStringPotential borrowing initial margin requirement for this currency in USD.
cash_bal: NumberStringCash balance of the currency.
ccy: StringCurrency code, for example BTC or USDT.
coin_usd_price: NumberStringUSD price index of the currency.
cross_liab: NumberStringCross-margin liabilities of the currency.
col_res: StringPlatform-level collateral restriction status.
Documented values:
"0": no restriction;"1": close to the platform collateral limit;"2": restriction enabled; the currency cannot provide margin for new orders.
collateral_enabled: boolWhether this currency is enabled as collateral.
Primarily applicable to Multi-currency margin mode.
col_borr_auto_conversion: StringAuto-conversion risk indicator.
Documented levels range from "0" through "5":
"0": no current auto-conversion risk;"1"to"3": increasing risk;"4": auto conversion may occur soon;"5": auto conversion is in progress.
dis_eq: NumberStringDiscounted equity of the currency in USD.
eq: NumberStringTotal equity of the currency.
eq_usd: NumberStringEquity of the currency denominated in USD.
smt_sync_eq: NumberStringSmart-sync equity.
The default is zero and the field is only applicable to copy traders.
spot_copy_trading_eq: NumberStringSpot smart-sync copy-trading equity.
The default is zero and the field is only applicable to copy traders.
fixed_bal: NumberStringBalance frozen for Dip Sniper and Peak Sniper products.
frozen_bal: NumberStringFrozen balance of the currency.
frp_type: StringForced-repayment type.
Documented values:
"0": no forced repayment;"1": user-based forced repayment;"2": platform-based forced repayment.
imr: NumberStringCurrency-level cross initial margin requirement.
interest: NumberStringAccrued interest for this currency.
iso_eq: NumberStringIsolated-margin equity of the currency.
iso_liab: NumberStringIsolated liabilities of the currency.
iso_upl: NumberStringIsolated unrealized profit and loss of the currency.
liab: NumberStringTotal liabilities of the currency.
OKX represents liabilities as a positive value.
max_loan: NumberStringMaximum amount of this currency that can currently be borrowed.
mgn_ratio: NumberStringCross-maintenance-margin ratio of the currency.
mmr: NumberStringCurrency-level cross maintenance margin requirement.
notional_lever: NumberStringLeverage calculated at the currency level.
Applicable to Futures mode.
ord_frozen: NumberStringMargin frozen by open orders for this currency.
reward_bal: NumberStringTrial-fund balance.
spot_in_use_amt: NumberStringActual spot-hedging amount currently in use.
Applicable to Portfolio margin mode.
cl_spot_in_use_amt: NumberStringUser-defined spot-hedging amount.
Applicable to Portfolio margin mode.
max_spot_in_use_amt: NumberStringMaximum spot-hedging amount calculated by OKX.
Applicable to Portfolio margin mode.
The exact JSON field is maxSpotInUseAmt.
spot_iso_bal: NumberStringSpot balance obtained through copy trading.
This includes amounts currently frozen by copy-trading open orders.
stgy_eq: NumberStringTotal equity assigned to trading-bot strategies for this currency.
twap: NumberStringForced-repayment risk indicator.
Values range from zero through five. A larger value indicates a higher probability that forced repayment will be triggered.
u_time: NumberStringTime when this currency entry was last updated.
Unix timestamp in milliseconds.
upl: NumberStringUnrealized profit and loss for margin and derivative positions of this currency.
upl_liab: NumberStringLiabilities caused by unrealized losses of this currency.
spot_bal: NumberStringSpot balance.
The unit is the currency itself, for example BTC.
open_avg_px: NumberStringAverage acquisition price of the current spot balance in USD.
This is a single JSON string, not an array.
acc_avg_px: NumberStringAccumulated average acquisition price of the spot balance in USD.
This is a single JSON string, not an array.
spot_upl: NumberStringSpot unrealized profit and loss in USD.
spot_upl_ratio: NumberStringSpot unrealized profit and loss ratio.
total_pnl: NumberStringAccumulated spot profit and loss in USD.
total_pnl_ratio: NumberStringAccumulated spot profit and loss ratio.
extra: ExtraFieldsAdditional per-currency fields introduced by OKX that are not yet represented explicitly.
Trait Implementations§
Source§impl Clone for AccountBalanceUpdate
impl Clone for AccountBalanceUpdate
Source§fn clone(&self) -> AccountBalanceUpdate
fn clone(&self) -> AccountBalanceUpdate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more