add /debug to dlobPublisher

This commit is contained in:
wphan
2024-12-02 17:38:18 -08:00
parent 09e83a6dae
commit 815c3c3ca1
7 changed files with 249 additions and 8 deletions

View File

@@ -247,7 +247,7 @@ export class DLOBSubscriberIO extends DLOBSubscriber {
l2Formatted['marketSlot'] !== lastMarketSlotAndTime.slot
) {
logger.warn(
`Updating market slot for ${marketArgs.marketName} with slot ${l2Formatted['marketSlot']}`
`Updating market slot for ${marketArgs.marketName} from ${lastMarketSlotAndTime.slot} -> ${l2Formatted['marketSlot']}`
);
this.lastMarketSlotMap
.get(marketArgs.marketType)
@@ -262,6 +262,13 @@ export class DLOBSubscriberIO extends DLOBSubscriber {
asks: l2Formatted.asks.slice(0, 100),
});
console.log(
`bbo: ${l2Formatted['marketName']}`,
(+l2Formatted.bids[0].price / 1e6).toFixed(4),
'//',
(+l2Formatted.asks[0].price / 1e6).toFixed(4)
);
this.redisClient.publish(
`${clientPrefix}orderbook_${marketType}_${marketArgs.marketIndex}`,
l2Formatted