Fix dashboard PnL using spot contract size of 1.

Prefer perpetual symbols and normalize before market.contractSize lookup so Gate BTC float matches ~0.4U not thousands.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-08-06 14:20:43 +08:00
parent 75a4175522
commit d41028b766
5 changed files with 91 additions and 22 deletions
+1 -1
View File
@@ -3416,7 +3416,7 @@ def resolve_order_entry_price(order_resp, exchange_symbol, fallback_price):
def get_contract_size(exchange_symbol):
ensure_markets_loaded()
market = exchange.market(exchange_symbol)
market = exchange.market(normalize_exchange_symbol(exchange_symbol))
return float(market.get("contractSize") or 1)