change indicative quotes id

This commit is contained in:
Nour Alharithi
2025-05-29 17:39:30 -07:00
parent 69e6159b46
commit 2c78aef965

View File

@@ -134,6 +134,7 @@ export class DLOBSubscriberIO extends DLOBSubscriber {
override async updateDLOB(): Promise<void> { override async updateDLOB(): Promise<void> {
await super.updateDLOB(); await super.updateDLOB();
let indicativeOrderId = 0;
for (const marketArgs of this.marketArgs) { for (const marketArgs of this.marketArgs) {
try { try {
if (this.indicativeQuotesRedisClient) { if (this.indicativeQuotesRedisClient) {
@@ -185,13 +186,14 @@ export class DLOBSubscriberIO extends DLOBSubscriber {
postedSlotTail: 0, postedSlotTail: 0,
}; };
if (quote['bid_size'] && quote['bid_price']) { if (quote['bid_size'] && quote['bid_price'] != null) {
// Sanity check bid price and size // Sanity check bid price and size
const indicativeBid: Order = Object.assign( const indicativeBid: Order = Object.assign(
{}, {},
indicativeBaseOrder, indicativeBaseOrder,
{ {
orderId: indicativeOrderId,
oraclePriceOffset: quote['is_oracle_offset'] oraclePriceOffset: quote['is_oracle_offset']
? quote['bid_price'] ? quote['bid_price']
: 0, : 0,
@@ -208,13 +210,15 @@ export class DLOBSubscriberIO extends DLOBSubscriber {
this.slotSource.getSlot(), this.slotSource.getSlot(),
false false
); );
indicativeOrderId += 1;
} }
if (quote['ask_size'] && quote['ask_price']) { if (quote['ask_size'] && quote['ask_price'] != null) {
const indicativeAsk: Order = Object.assign( const indicativeAsk: Order = Object.assign(
{}, {},
indicativeBaseOrder, indicativeBaseOrder,
{ {
orderId: indicativeOrderId,
oraclePriceOffset: quote['is_oracle_offset'] oraclePriceOffset: quote['is_oracle_offset']
? quote['ask_price'] ? quote['ask_price']
: 0, : 0,
@@ -231,6 +235,7 @@ export class DLOBSubscriberIO extends DLOBSubscriber {
this.slotSource.getSlot(), this.slotSource.getSlot(),
false false
); );
indicativeOrderId += 1;
} }
} }
} }