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 CMD3020union_currency, ensuringcashis denominated in the requested currency. - Legacy single-currency accounts: cash in account’s primary market
currency. Only one entry in
cash_info_list; top-levelcashequals that entry’scash.
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>按市场细分的资产信息列表