dlob add fetch indicative quotes (#372)

* dlob add fetch indicative quotes

* indicative ws stream

* prettify

* allow for oracle orders
This commit is contained in:
moosecat
2025-04-16 12:06:21 -07:00
committed by GitHub
parent 6d1a11f805
commit b3b655dc65
6 changed files with 405 additions and 260 deletions

View File

@@ -313,6 +313,9 @@ const main = async () => {
});
await redisClient.connect();
const indicativeRedisClient = new RedisClient({});
await indicativeRedisClient.connect();
const connection = new Connection(endpoint, {
wsEndpoint: wsEndpoint,
commitment: stateCommitment,
@@ -506,7 +509,7 @@ const main = async () => {
});
await dlobSubscriber.subscribe();
const dlobSubscriberPmm = new DLOBSubscriberIO({
const dlobSubscriberIndicative = new DLOBSubscriberIO({
driftClient,
env: driftEnv,
dlobSource: dlobProvider,
@@ -518,8 +521,9 @@ const main = async () => {
spotMarketInfos,
killSwitchSlotDiffThreshold: KILLSWITCH_SLOT_DIFF_THRESHOLD,
protectedMakerView: true,
indicativeQuotesRedisClient: indicativeRedisClient,
});
await dlobSubscriberPmm.subscribe();
await dlobSubscriberIndicative.subscribe();
if (useWebsocket && !FEATURE_FLAGS.DISABLE_GPA_REFRESH) {
const recursiveFetch = (delay = WS_FALLBACK_FETCH_INTERVAL) => {
@@ -595,7 +599,6 @@ const main = async () => {
const handleDebug = async (req: Request, res: Response) => {
const marketIndex = +req.query.marketIndex;
const protectedMakerView = req.query.includePmm === 'true';
let marketType: MarketType = MarketType.PERP;
let oraclePriceData: OraclePriceData;
if (req.query.marketType === 'spot') {
@@ -606,7 +609,7 @@ const main = async () => {
}
try {
const slot = slotSource.getSlot();
const dlob = await dlobProvider.getDLOB(slot, protectedMakerView);
const dlob = await dlobProvider.getDLOB(slot);
const l2 = dlob.getL2({
marketIndex,
marketType,
@@ -629,7 +632,6 @@ const main = async () => {
},
l2: l2WithBNToStrings(l2),
l3,
includePmm: protectedMakerView,
};
res.json(state);