'ohlc' pubsub message has period
This commit is contained in:
@@ -506,11 +506,8 @@ def pub_ohlc(_series:str, key: OHLCKey, bars: list[NativeOHLC]):
|
||||
pool_addr, period = key
|
||||
chain_id = current_chain.get().chain_id
|
||||
period = period_name(period)
|
||||
return (
|
||||
f'{chain_id}|{pool_addr}|{period}', # channel name is like 0x...|1m
|
||||
'ohlc',
|
||||
(chain_id, pool_addr, period, [b.ohlc for b in bars])
|
||||
)
|
||||
key = f'{pool_addr}|{period}'
|
||||
return f'{chain_id}|{key}', 'ohlc', (chain_id, key, [b.ohlc for b in bars])
|
||||
|
||||
def ohlc_key_to_str(k):
|
||||
return f'{k[0]}|{period_name(k[1])}'
|
||||
|
||||
Reference in New Issue
Block a user