include latest slot in get vamm l2 generator and in calcualteBidAskPrice

This commit is contained in:
Nour Alharithi
2025-08-21 10:20:46 -07:00
parent f64e720232
commit de29c40262

View File

@@ -186,7 +186,9 @@ export class DLOBSubscriberIO extends DLOBSubscriber {
this.driftClient.getMMOracleDataForPerpMarket( this.driftClient.getMMOracleDataForPerpMarket(
marketArgs.marketIndex marketArgs.marketIndex
), ),
true true,
undefined,
new BN(this.slotSource.getSlot())
); );
bestBid = bestBid =
@@ -362,7 +364,11 @@ export class DLOBSubscriberIO extends DLOBSubscriber {
includeVamm = false; includeVamm = false;
} }
const l2 = this.getL2({ ...l2FuncArgs, includeVamm }); const l2 = this.getL2({
...l2FuncArgs,
includeVamm,
latestSlot: new BN(this.slotSource.getSlot()),
});
const { markPrice, bestBidPrice, bestAskPrice, spreadPct, spreadQuote } = const { markPrice, bestBidPrice, bestAskPrice, spreadPct, spreadQuote } =
COMMON_MATH.calculateSpreadBidAskMark(l2); COMMON_MATH.calculateSpreadBidAskMark(l2);
const slot = l2.slot; const slot = l2.slot;