diff --git a/src/dlobProvider.ts b/src/dlobProvider.ts index 4da8f79..1d82f56 100644 --- a/src/dlobProvider.ts +++ b/src/dlobProvider.ts @@ -3,7 +3,7 @@ import { PublicKey } from '@solana/web3.js'; export type DLOBProvider = { subscribe(): Promise; - getDLOB(slot: number): Promise; + getDLOB(slot: number, protectedMakerView: boolean): Promise; getUniqueAuthorities(): PublicKey[]; getUserAccounts(): Generator<{ userAccount: UserAccount; @@ -20,8 +20,8 @@ export function getDLOBProviderFromUserMap(userMap: UserMap): DLOBProvider { subscribe: async () => { await userMap.subscribe(); }, - getDLOB: async (slot: number) => { - return await userMap.getDLOB(slot); + getDLOB: async (slot: number, protectedMakerView: boolean) => { + return await userMap.getDLOB(slot, protectedMakerView); }, getUniqueAuthorities: () => { return userMap.getUniqueAuthorities(); @@ -56,8 +56,8 @@ export function getDLOBProviderFromOrderSubscriber( subscribe: async () => { await orderSubscriber.subscribe(); }, - getDLOB: async (slot: number) => { - return await orderSubscriber.getDLOB(slot); + getDLOB: async (slot: number, protectedMakerView: boolean) => { + return await orderSubscriber.getDLOB(slot, protectedMakerView); }, getUniqueAuthorities: () => { const authorities = new Set(); diff --git a/src/publishers/dlobPublisher.ts b/src/publishers/dlobPublisher.ts index 8581a36..1b6e9e1 100644 --- a/src/publishers/dlobPublisher.ts +++ b/src/publishers/dlobPublisher.ts @@ -590,6 +590,7 @@ 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') { @@ -600,7 +601,7 @@ const main = async () => { } try { const slot = slotSource.getSlot(); - const dlob = await dlobProvider.getDLOB(slot); + const dlob = await dlobProvider.getDLOB(slot, protectedMakerView); const l2 = dlob.getL2({ marketIndex, marketType, @@ -623,6 +624,7 @@ const main = async () => { }, l2: l2WithBNToStrings(l2), l3, + includePmm: protectedMakerView, }; res.json(state);