Fix KeyError for prefixed coins in historical candle fetch

Bypass SDK's name_to_coin lookup in candles_snapshot by calling
http_info.post directly with the raw coin name. This fixes
KeyError for symbols like xyz:GOLD, xyz:CL, mkts:USTECH that
aren't in the name_to_coin dictionary.

The WebSocket subscription already bypassed this lookup (line 154),
but the historical fetch path did not.
This commit is contained in:
DiTus
2026-08-05 09:20:07 +02:00
parent 21be9b40b7
commit 967c86e8e9
4 changed files with 27 additions and 10 deletions

View File

@ -87,7 +87,8 @@ def detect_and_fill_gaps(coin, conn):
current_start = gap_start_ms
while current_start < gap_end_ms:
try:
batch = info.candles_snapshot(coin, "1m", current_start, gap_end_ms)
req = {"coin": coin, "interval": "1m", "startTime": current_start, "endTime": gap_end_ms}
batch = info.post("/info", {"type": "candleSnapshot", "req": req})
if not batch:
break