Skip to main content

Funds

Struct Funds 

Source
pub struct Funds {
Show 38 fields pub power: f64, pub total_assets: f64, pub cash: f64, pub market_val: f64, pub frozen_cash: f64, pub debt_cash: f64, pub avl_withdrawal_cash: f64, pub currency: Option<i32>, pub available_funds: Option<f64>, pub unrealized_pl: Option<f64>, pub realized_pl: Option<f64>, pub risk_level: Option<i32>, pub risk_status: Option<i32>, pub initial_margin: Option<f64>, pub maintenance_margin: Option<f64>, pub margin_call_margin: Option<f64>, pub max_power_short: Option<f64>, pub net_cash_power: Option<f64>, pub long_mv: Option<f64>, pub short_mv: Option<f64>, pub pending_asset: Option<f64>, pub max_withdrawal: Option<f64>, pub is_pdt: Option<bool>, pub pdt_seq: Option<String>, pub beginning_dtbp: Option<f64>, pub remaining_dtbp: Option<f64>, pub dt_call_amount: Option<f64>, pub dt_status: Option<i32>, pub securities_assets: Option<f64>, pub fund_assets: Option<f64>, pub bond_assets: Option<f64>, pub crypto_mv: Option<f64>, pub exposure_level: Option<i32>, pub exposure_limit: Option<f64>, pub used_limit: Option<f64>, pub remaining_limit: Option<f64>, pub cash_info_list: Vec<FundsCashInfo>, pub market_info_list: Vec<FundsMarketInfo>,
}
Expand description

账户资金

v1.4.73 BUG-004 fix(eli v1.4.71 AI tester P0 报告):之前只暴露 7 字段 给 MCP,而 C++ Python SDK accinfo_query 返 63+。MCP 客户端做多币种 / 多市场管理 / 风控监测都用不起来。本版补 18 个关键字段:

  • currency:必备(之前 MCP 完全缺失,agent 无从判断币种)
  • available_funds:margin 账户可用资金(不同于 cash)
  • unrealized_pl / realized_pl:持仓盈亏
  • risk_level / risk_status:账户风控级别 / 状态
  • initial_margin / maintenance_margin / margin_call_margin:保证金
  • max_power_short:做空可用
  • long_mv / short_mv:多空持仓市值
  • pending_asset:挂单占用资产
  • max_withdrawal:可取现上限
  • is_pdt / pdt_seq / remaining_dtbp / dt_call_amount / dt_status: US 账户 Pattern Day Trader 相关(关键风控指标)
  • securities_assets / fund_assets / bond_assets:资产类别 breakdown

保留 cash_info_list / market_info_list 为 raw proto,v1.4.74+ 按需解析。

Fields§

§power: f64

购买力

§total_assets: f64

资产净值(总资产)

§cash: f64

现金 — top-level summary cash, in currency field’s currency.

v1.4.106 codex 1612 Candidate A: This is NOT a cross-currency sum of cash_info_list[].cash. Different currencies cannot be summed without FX conversion. Backend (Ndt_Trd_AccFund.fTotalCash) directly populates this field, faithfully relayed via pFunds->set_cash(nnFunds.fTotalCash) in C++ APIServer_Trd_GetFunds.cpp::FillFunds.

Semantics by account type:

  • Futures / Universal: cash in union_currency (request currency or account base if not requested). v1.4.106 codex 1556 F1 fix: daemon now passes user-requested currency to CMD3020 union_currency, ensuring cash is denominated in the requested currency.
  • Legacy single-currency accounts: cash in account’s primary market currency. Only one entry in cash_info_list; top-level cash equals that entry’s cash.

To match Futu mobile app’s ‘现金总值 in HKD’ display for universal accounts, client must compute sum(cash_info_list[i].cash * fx_rate(...)) — daemon does not perform FX aggregation. Per-currency breakdown is in cash_info_list.

§market_val: f64

证券市值

§frozen_cash: f64

冻结金额(未成交委托锁住的资金)

§debt_cash: f64

欠款金额(融资或透支)

§avl_withdrawal_cash: f64

可提金额

§currency: Option<i32>

账户主币种(HKD / USD / CNH / …,对齐 proto TrdCommon.Currency

§available_funds: Option<f64>

可用资金

§unrealized_pl: Option<f64>

未实现盈亏

§realized_pl: Option<f64>

已实现盈亏

§risk_level: Option<i32>

账户风险等级

§risk_status: Option<i32>

账户风险状态(预警 / 追保 / 平仓等)

§initial_margin: Option<f64>

起始保证金

§maintenance_margin: Option<f64>

维持保证金

§margin_call_margin: Option<f64>

Margin Call 保证金

§max_power_short: Option<f64>

做空最大购买力

§net_cash_power: Option<f64>

净现金购买力(无杠杆)

§long_mv: Option<f64>

多头市值

§short_mv: Option<f64>

空头市值

§pending_asset: Option<f64>

在途资产(T+N 未结算)

§max_withdrawal: Option<f64>

最大可提资金

§is_pdt: Option<bool>

是否为 Pattern Day Trader(美股规则)

§pdt_seq: Option<String>

PDT 违规序号 (mobile UI: 剩余日内交易次数)

§beginning_dtbp: Option<f64>

v1.4.98 T1-4: 初始日内交易购买力 (DTBP, US PDT 账户)

§remaining_dtbp: Option<f64>

剩余日内交易购买力 (DTBP)

§dt_call_amount: Option<f64>

日内追保金额 (DT Call)

§dt_status: Option<i32>

日内保证金状态

§securities_assets: Option<f64>

证券资产

§fund_assets: Option<f64>

基金资产

§bond_assets: Option<f64>

债券资产

§crypto_mv: Option<f64>

数字货币市值

§exposure_level: Option<i32>

数字货币风险等级

§exposure_limit: Option<f64>

数字货币持仓限额

§used_limit: Option<f64>

数字货币已用限额

§remaining_limit: Option<f64>

数字货币剩余额度

§cash_info_list: Vec<FundsCashInfo>

按币种细分的现金信息列表

§market_info_list: Vec<FundsMarketInfo>

按市场细分的资产信息列表

Implementations§

Source§

impl Funds

Source

pub fn from_proto(f: &Funds) -> Self

Trait Implementations§

Source§

impl Clone for Funds

Source§

fn clone(&self) -> Funds

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Funds

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Funds

§

impl RefUnwindSafe for Funds

§

impl Send for Funds

§

impl Sync for Funds

§

impl Unpin for Funds

§

impl UnsafeUnpin for Funds

§

impl UnwindSafe for Funds

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more