diff --git a/pool.js b/pool.js index f670996..8febb83 100644 --- a/pool.js +++ b/pool.js @@ -23,8 +23,11 @@ export async function subOHLCs( socket, chainId, poolPeriods) { for(const key of poolPeriods) { const room = `${chainId}|${key}`; socket.join(room) - const ohlc = await ohlcs.get(chainId,key); + let ohlc = await ohlcs.get(chainId,key); console.log('got ohlc', ohlc) + if (typeof(ohlc)==='string') { + ohlc = JSON.parse(ohlc) + } socket.emit('ohlc', chainId, key, ohlc) console.log('joined room', room) }