feat: restructure OKX options UI with header funds, settings card, and dual-column layout

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-07 09:36:00 +08:00
parent 38f6bc240e
commit 090b9c6215
15 changed files with 619 additions and 225 deletions
+9 -2
View File
@@ -85,11 +85,18 @@ def profit_loss_ratio_from_trades(trades: list[dict[str, Any]] | None) -> float
return profit_loss_ratio_from_averages(avg_win, avg_loss)
def total_funds_usdt(funding_usdt: float | None, trading_usdt: float | None) -> float | None:
def total_funds_usdt(
funding_usdt: float | None,
trading_usdt: float | None,
options_trading_usdc: float | None = None,
) -> float | None:
if funding_usdt is None:
return None
try:
return round(float(funding_usdt) + float(trading_usdt or 0), 2)
total = float(funding_usdt) + float(trading_usdt or 0)
if options_trading_usdc is not None:
total += float(options_trading_usdc)
return round(total, 2)
except (TypeError, ValueError):
return None