From 0ea0ae9aa4ff12a76c52c603b1d03dd99eb6ebaa Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 02:03:38 +0000 Subject: [PATCH 1/3] Bumping drift-common to 91d481817efb5fd18aa4a4701f2c49bcaa84355b --- drift-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drift-common b/drift-common index 6ae9e65..91d4818 160000 --- a/drift-common +++ b/drift-common @@ -1 +1 @@ -Subproject commit 6ae9e6541b336e9777e48ac517bc0705ae3d5fcf +Subproject commit 91d481817efb5fd18aa4a4701f2c49bcaa84355b From 68235a029e609c8c1deea633d4fc991cbf02571d Mon Sep 17 00:00:00 2001 From: jack Date: Thu, 24 Jul 2025 12:17:14 +1000 Subject: [PATCH 2/3] chore: add mark price to dlob response (#462) --- src/dlob-subscriber/DLOBSubscriberIO.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/dlob-subscriber/DLOBSubscriberIO.ts b/src/dlob-subscriber/DLOBSubscriberIO.ts index 3eaaeb1..1149945 100644 --- a/src/dlob-subscriber/DLOBSubscriberIO.ts +++ b/src/dlob-subscriber/DLOBSubscriberIO.ts @@ -31,6 +31,7 @@ import { import { OffloadQueue } from '../utils/offload'; import { setHealthStatus, HEALTH_STATUS } from '../core/healthCheck'; import { CounterValue } from '../core/metricsV2'; +import { COMMON_MATH } from '@drift/common'; export type wsMarketArgs = { marketIndex: number; @@ -354,6 +355,7 @@ export class DLOBSubscriberIO extends DLOBSubscriber { } const l2 = this.getL2({ ...l2FuncArgs, includeVamm }); + const { markPrice } = COMMON_MATH.calculateSpreadBidAskMark(l2); const slot = l2.slot; if (slot) { @@ -379,6 +381,8 @@ export class DLOBSubscriberIO extends DLOBSubscriber { l2Formatted['marketIndex'] = marketArgs.marketIndex; l2Formatted['ts'] = Date.now(); l2Formatted['slot'] = slot; + l2Formatted['markPrice'] = markPrice?.toString(); + addOracletoResponse( l2Formatted, this.driftClient, @@ -392,6 +396,10 @@ export class DLOBSubscriberIO extends DLOBSubscriber { marketArgs.marketIndex ); + if (!markPrice) { + l2Formatted['markPrice'] = l2Formatted['oracle']; + } + // Check if slot diffs are too large for oracle const skipSlotCheck = (marketType === 'perp' && From a616aa694581539aeeb72eb433c381470faaa7b4 Mon Sep 17 00:00:00 2001 From: lowkeynicc <85139158+lowkeynicc@users.noreply.github.com> Date: Wed, 23 Jul 2025 23:00:09 -0400 Subject: [PATCH 3/3] include additional info in l2formatted (#463) --- src/dlob-subscriber/DLOBSubscriberIO.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/dlob-subscriber/DLOBSubscriberIO.ts b/src/dlob-subscriber/DLOBSubscriberIO.ts index 1149945..20c2867 100644 --- a/src/dlob-subscriber/DLOBSubscriberIO.ts +++ b/src/dlob-subscriber/DLOBSubscriberIO.ts @@ -355,7 +355,8 @@ export class DLOBSubscriberIO extends DLOBSubscriber { } const l2 = this.getL2({ ...l2FuncArgs, includeVamm }); - const { markPrice } = COMMON_MATH.calculateSpreadBidAskMark(l2); + const { markPrice, bestBidPrice, bestAskPrice, spreadPct, spreadQuote } = + COMMON_MATH.calculateSpreadBidAskMark(l2); const slot = l2.slot; if (slot) { @@ -382,6 +383,10 @@ export class DLOBSubscriberIO extends DLOBSubscriber { l2Formatted['ts'] = Date.now(); l2Formatted['slot'] = slot; l2Formatted['markPrice'] = markPrice?.toString(); + l2Formatted['bestBidPrice'] = bestBidPrice?.toString(); + l2Formatted['bestAskPrice'] = bestAskPrice?.toString(); + l2Formatted['spreadPct'] = spreadPct?.toString(); + l2Formatted['spreadQuote'] = spreadQuote?.toString(); addOracletoResponse( l2Formatted,