symbol switching fix; max amount

This commit is contained in:
Tim
2024-04-12 16:46:34 -04:00
parent fe1b633c4a
commit 0084847d82
7 changed files with 88 additions and 28 deletions

View File

@@ -22,9 +22,14 @@ socket.on('p', async (chainId, pool, price) => {
s.poolPrices[[chainId,pool]] = price
})
socket.on('ohlc', async (chainId, pool, ohlcs) => {
// console.log('pool bars', pool, ohlcs)
DataFeed.poolCallback(chainId, pool, ohlcs)
socket.on('ohlc', async (chainId, poolPeriod, ohlcs) => {
// console.log('pool bars', poolPeriod, ohlcs)
if (ohlcs && ohlcs.length) {
const split = poolPeriod.indexOf('|')
const pool = poolPeriod.slice(0,split)
useStore().poolPrices[[chainId, pool]] = ohlcs[ohlcs.length - 1][4] // closing price
}
DataFeed.poolCallback(chainId, poolPeriod, ohlcs)
})
socket.on('vb', async (chainId, vault, balances) => {