pool fee selection; ohlc subs

This commit is contained in:
Tim
2024-03-13 15:48:19 -04:00
parent d98ca3fd1c
commit 5388611e94
2 changed files with 4 additions and 0 deletions

View File

@@ -81,3 +81,4 @@ export const prices = new CacheDict('p')
export const orderStatuses = new CacheDict('o')
export const vaultOpenOrders = new CacheDict('voo')
export const orderFilled = new CacheDict('of')
export const ohlcs = new CacheDict('ohlc')

View File

@@ -1,8 +1,10 @@
import {ohlcs, prices} from "./cache.js";
export function subPools( socket, chainId, addresses) {
for(const address of addresses) {
const room = `${chainId}|${address}`;
socket.join(room)
socket.emit('p', chainId, address, prices[address])
console.log('joined room', room)
}
}
@@ -20,6 +22,7 @@ export function subOHLCs( socket, chainId, poolPeriods) {
for(const key of poolPeriods) {
const room = `${chainId}|${key}`;
socket.join(room)
socket.emit('ohlc', chainId, key, ohlcs[key])
console.log('joined room', room)
}
}