vault recent orders (status bugfix)

This commit is contained in:
Tim
2024-04-11 16:27:03 -04:00
parent 39de96bca5
commit 59740cf6e9
3 changed files with 31 additions and 27 deletions

View File

@@ -29,9 +29,9 @@ export class CacheDict {
this.series = series
}
async get(chain, key) {
async get(chain, key, default_=null) {
const result = await redis.hGet(`${chain}|${this.series}`, key)
return result === null ? null : '' + result
return result === null ? default_ : '' + result
}
async contains(chain, key) {
@@ -80,5 +80,6 @@ export const vaultBalances = new CacheDict('vb')
export const prices = new CacheDict('p')
export const orderStatuses = new CacheDict('o')
export const vaultOpenOrders = new CacheDict('voo')
export const vaultRecentlyClosedOrders = new CacheDict('vrco')
export const orderFilled = new CacheDict('of')
export const ohlcs = new CacheDict('ohlc')