chore: update to common redis + top markers account flag

This commit is contained in:
Jack Waller
2024-05-16 12:39:44 +10:00
parent cd26f39c72
commit 956a031fec
13 changed files with 1699 additions and 316 deletions

View File

@@ -9,7 +9,8 @@ import {
groupL2,
isVariant,
} from '@drift-labs/sdk';
import { RedisClient } from '../utils/redisClient';
import { RedisClient } from '@drift/common';
import {
SubscriberLookup,
addMarketSlotToResponse,
@@ -261,25 +262,25 @@ export class DLOBSubscriberIO extends DLOBSubscriber {
asks: l2Formatted.asks.slice(0, 5),
});
this.redisClient.client.publish(
this.redisClient.publish(
`orderbook_${marketType}_${marketArgs.marketIndex}`,
JSON.stringify(l2Formatted)
l2Formatted
);
this.redisClient.client.set(
this.redisClient.set(
`last_update_orderbook_${marketType}_${marketArgs.marketIndex}`,
JSON.stringify(l2Formatted_depth100)
l2Formatted_depth100
);
this.redisClient.client.set(
this.redisClient.set(
`last_update_orderbook_${marketType}_${marketArgs.marketIndex}_depth_100`,
JSON.stringify(l2Formatted_depth100)
l2Formatted_depth100
);
this.redisClient.client.set(
this.redisClient.set(
`last_update_orderbook_${marketType}_${marketArgs.marketIndex}_depth_20`,
JSON.stringify(l2Formatted_depth20)
l2Formatted_depth20
);
this.redisClient.client.set(
this.redisClient.set(
`last_update_orderbook_${marketType}_${marketArgs.marketIndex}_depth_5`,
JSON.stringify(l2Formatted_depth5)
l2Formatted_depth5
);
const oraclePriceData =
@@ -306,9 +307,9 @@ export class DLOBSubscriberIO extends DLOBSubscriber {
numMakers: 4,
})
.map((x) => x.toString());
this.redisClient.client.set(
this.redisClient.set(
`last_update_orderbook_best_makers_${marketType}_${marketArgs.marketIndex}`,
JSON.stringify({ bids, asks, slot })
{ bids, asks, slot }
);
}
@@ -361,9 +362,9 @@ export class DLOBSubscriberIO extends DLOBSubscriber {
marketArgs.marketIndex
);
this.redisClient.client.set(
this.redisClient.set(
`last_update_orderbook_l3_${marketType}_${marketArgs.marketIndex}`,
JSON.stringify(l3)
l3
);
}
}