fix: use BTC for DB queries and BTCUSDT for Bybit API (v1.3.1)

This commit is contained in:
Gemini CLI
2026-03-05 22:15:01 +01:00
parent 7c6faebead
commit b5cc51a4d2

View File

@ -68,7 +68,7 @@ class DatabaseManager:
class PingPongBot: class PingPongBot:
def __init__(self, config_path="config/ping_pong_config.yaml"): def __init__(self, config_path="config/ping_pong_config.yaml"):
self.version = "1.3.0" self.version = "1.3.1"
with open(config_path, 'r') as f: with open(config_path, 'r') as f:
self.config = yaml.safe_load(f) self.config = yaml.safe_load(f)
@ -86,7 +86,8 @@ class PingPongBot:
self.db = DatabaseManager() self.db = DatabaseManager()
self.symbol = self.config['symbol'] self.symbol = self.config['symbol'].upper() # e.g. BTCUSDT
self.db_symbol = self.symbol.replace("USDT", "") # e.g. BTC
self.interval = str(self.config['interval']) self.interval = str(self.config['interval'])
self.direction = self.config['direction'].lower() self.direction = self.config['direction'].lower()
@ -256,7 +257,7 @@ class PingPongBot:
last_exchange_update = now last_exchange_update = now
# 2. DB Sync (5s) # 2. DB Sync (5s)
candles = await self.db.get_candles(self.symbol, self.interval, limit=100) candles = await self.db.get_candles(self.db_symbol, self.interval, limit=100)
if candles: if candles:
latest = candles[0] latest = candles[0]
if latest['time'] != self.last_candle_time: if latest['time'] != self.last_candle_time: