Browse Source

Remove async/await from set_initial_balance method in TradingEngine, enhancing code simplicity and performance during balance initialization.

Carles Sentis 2 days ago
parent
commit
e2b981eb1a
2 changed files with 2 additions and 2 deletions
  1. 1 1
      src/trading/trading_engine.py
  2. 1 1
      trading_bot.py

+ 1 - 1
src/trading/trading_engine.py

@@ -65,7 +65,7 @@ class TradingEngine:
             if balance and balance.get('total'):
                 usdc_balance = float(balance['total'].get('USDC', 0))
                 # The set_initial_balance method is synchronous
-                await self.stats.set_initial_balance(usdc_balance)
+                self.stats.set_initial_balance(usdc_balance)
         except Exception as e:
             logger.error(f"Could not set initial balance during async init: {e}", exc_info=True)
     

+ 1 - 1
trading_bot.py

@@ -14,7 +14,7 @@ from datetime import datetime
 from pathlib import Path
 
 # Bot version
-BOT_VERSION = "2.4.249"
+BOT_VERSION = "2.4.250"
 
 # Add src directory to Python path
 sys.path.insert(0, str(Path(__file__).parent / "src"))