feat: options UI scroll layout, stats card, funding balance, and cross-account transfer
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -89,11 +89,14 @@ def total_funds_usdt(
|
||||
funding_usdt: float | None,
|
||||
trading_usdt: float | None,
|
||||
options_trading_usdc: float | None = None,
|
||||
options_funding_usdc: float | None = None,
|
||||
) -> float | None:
|
||||
if funding_usdt is None:
|
||||
return None
|
||||
try:
|
||||
total = float(funding_usdt) + float(trading_usdt or 0)
|
||||
if options_funding_usdc is not None:
|
||||
total += float(options_funding_usdc)
|
||||
if options_trading_usdc is not None:
|
||||
total += float(options_trading_usdc)
|
||||
return round(total, 2)
|
||||
|
||||
@@ -1061,6 +1061,11 @@ function refreshAccountSnapshot(){
|
||||
const el = document.getElementById("current-capital");
|
||||
if(el) el.innerText = `${Number(data.current_capital).toFixed(2)}U`;
|
||||
}
|
||||
if (typeof data.options_funding_usdc !== "undefined") {
|
||||
const el = document.getElementById("options-funding-usdc");
|
||||
if (el) el.innerText = (data.options_funding_usdc === null || data.options_funding_usdc === undefined)
|
||||
? "—" : `${Number(data.options_funding_usdc).toFixed(2)} USDC`;
|
||||
}
|
||||
if (typeof data.options_trading_usdc !== "undefined") {
|
||||
const el = document.getElementById("options-trading-usdc");
|
||||
if (el) el.innerText = (data.options_trading_usdc === null || data.options_trading_usdc === undefined)
|
||||
|
||||
@@ -1612,6 +1612,11 @@ function refreshAccountSnapshot(){
|
||||
const el = document.getElementById("current-capital");
|
||||
if(el) el.innerText = `${Number(data.current_capital).toFixed(2)}U`;
|
||||
}
|
||||
if (typeof data.options_funding_usdc !== "undefined") {
|
||||
const el = document.getElementById("options-funding-usdc");
|
||||
if (el) el.innerText = (data.options_funding_usdc === null || data.options_funding_usdc === undefined)
|
||||
? "—" : `${Number(data.options_funding_usdc).toFixed(2)} USDC`;
|
||||
}
|
||||
if (typeof data.options_trading_usdc !== "undefined") {
|
||||
const el = document.getElementById("options-trading-usdc");
|
||||
if (el) el.innerText = (data.options_trading_usdc === null || data.options_trading_usdc === undefined)
|
||||
|
||||
@@ -75,6 +75,10 @@
|
||||
<div class="value" id="current-capital">{{ funds_fmt(current_capital) }}U</div>
|
||||
</div>
|
||||
{% if options_enabled %}
|
||||
<div class="stat-strip-item">
|
||||
<div class="label">期权资金账户</div>
|
||||
<div class="value" id="options-funding-usdc">{% if options_funding_usdc is not none %}{{ funds_fmt(options_funding_usdc) }} USDC{% else %}—{% endif %}</div>
|
||||
</div>
|
||||
<div class="stat-strip-item">
|
||||
<div class="label">期权交易账户</div>
|
||||
<div class="value" id="options-trading-usdc">{% if options_trading_usdc is not none %}{{ funds_fmt(options_trading_usdc) }} USDC{% else %}—{% endif %}</div>
|
||||
|
||||
Reference in New Issue
Block a user