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:
@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user