fix: динамический список монет для баланса из конфига
Хардкоженный список не включал DOGE/ADA/DOT → баланс занижался на ~$6 (не считал DOGE позицию). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -307,7 +307,11 @@ def _send_balance(cfg):
|
||||
# Collect balances and convert to USDC
|
||||
total_usdc = 0.0
|
||||
coin_lines = []
|
||||
for coin in ["USDC", "USDT", "BTC", "ETH", "SOL", "AVAX", "LINK", "XRP"]:
|
||||
# Build coin list from configured assets + stablecoins
|
||||
coins = {"USDC", "USDT"}
|
||||
for a in cfg.assets:
|
||||
coins.add(a.symbol.split("/")[0])
|
||||
for coin in sorted(coins):
|
||||
free = float(b.get(coin, {}).get("free", 0) or 0)
|
||||
total = float(b.get(coin, {}).get("total", 0) or 0)
|
||||
if total < 0.0001:
|
||||
|
||||
@@ -56,7 +56,11 @@ def _get_exchange_balance(cfg) -> float | None:
|
||||
spot._ensure_markets()
|
||||
b = spot.exchange.fetch_balance()
|
||||
total = 0.0
|
||||
for coin in ["USDC", "USDT", "BTC", "ETH", "SOL", "AVAX", "LINK", "XRP"]:
|
||||
# Build coin list from configured assets + stablecoins
|
||||
coins = {"USDC", "USDT"}
|
||||
for a in cfg.assets:
|
||||
coins.add(a.symbol.split("/")[0])
|
||||
for coin in sorted(coins):
|
||||
amt = float(b.get(coin, {}).get("total", 0) or 0)
|
||||
if amt < 0.0001:
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user