Cap options budget-full sizing at min(balance, trade budget) with UI hint.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-26 08:54:38 +08:00
parent 846f3de525
commit a2075ba73e
5 changed files with 41 additions and 4 deletions
+5
View File
@@ -259,6 +259,11 @@ def eth_amount_from_sheets(sheets: int, ct_mult: float = 0.01) -> float:
return round(int(sheets) * float(ct_mult), 8)
def resolve_budget_full_usdc(trading_usdc: float, trade_budget_usdc: float) -> float:
"""按可用余额打满:余额大于预算用预算,否则用余额."""
return min(float(trading_usdc), float(trade_budget_usdc))
def calc_order_size(
*,
quote_per_unit: float,