fix: динамический список монет для баланса из конфига

Хардкоженный список не включал DOGE/ADA/DOT → баланс
занижался на ~$6 (не считал DOGE позицию).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
anor
2026-03-09 19:33:17 +10:00
co-authored by Claude Opus 4.6
parent cc5b5cfeff
commit 551831f8c6
2 changed files with 10 additions and 2 deletions
+5 -1
View File
@@ -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:
+5 -1
View File
@@ -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