From 0db35808fc80a9e51e5c1daefddf5994b8ea8b69 Mon Sep 17 00:00:00 2001 From: wphan Date: Fri, 15 Dec 2023 16:23:42 -0800 Subject: [PATCH] example --- src/dlob-subscriber/DLOBSubscriberIO.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/dlob-subscriber/DLOBSubscriberIO.ts b/src/dlob-subscriber/DLOBSubscriberIO.ts index 1f6faf1..b277304 100644 --- a/src/dlob-subscriber/DLOBSubscriberIO.ts +++ b/src/dlob-subscriber/DLOBSubscriberIO.ts @@ -144,6 +144,13 @@ export class DLOBSubscriberIO extends DLOBSubscriber { asks: l2Formatted.asks.slice(0, 5), }); + const orderSubscriberSlot = this.slotSource.getSlot(); + const dlobOracleSlot = l2Formatted['oracle']['slot']; + if (Math.abs(orderSubscriberSlot - dlobOracleSlot) > 50) { + noticeSlack('dlobsubscirber kiling itstelf slot breakokren') + process.exit(420); + } + this.redisClient.client.publish( `orderbook_${marketType}_${l2Args.marketIndex}`, JSON.stringify(l2Formatted)