This commit is contained in:
Nour Alharithi
2023-10-25 11:16:07 -07:00
parent 9bb5c9c062
commit 99cd43c012

View File

@@ -47,7 +47,7 @@ export class DLOBSubscriberIO extends DLOBSubscriber {
includeVamm: true,
numVammOrders: 100,
updateOnChange: true,
fallbackL2Generators: []
fallbackL2Generators: [],
});
}
for (const market of MainnetSpotMarkets) {
@@ -58,7 +58,7 @@ export class DLOBSubscriberIO extends DLOBSubscriber {
depth: 2,
includeVamm: false,
updateOnChange: true,
fallbackL2Generators: []
fallbackL2Generators: [],
});
}
}
@@ -82,10 +82,17 @@ export class DLOBSubscriberIO extends DLOBSubscriber {
l2Formatted = l2WithBNToStrings(l2);
}
if (l2Args.updateOnChange && this.lastSeenL2Formatted.get(l2Args.marketType)?.get(l2Args.marketIndex) === JSON.stringify(l2Formatted)) {
if (
l2Args.updateOnChange &&
this.lastSeenL2Formatted
.get(l2Args.marketType)
?.get(l2Args.marketIndex) === JSON.stringify(l2Formatted)
) {
return;
}
this.lastSeenL2Formatted.get(l2Args.marketType)?.set(l2Args.marketIndex, JSON.stringify(l2Formatted));
this.lastSeenL2Formatted
.get(l2Args.marketType)
?.set(l2Args.marketIndex, JSON.stringify(l2Formatted));
l2Formatted['marketName'] = l2Args.marketName;
l2Formatted['marketType'] = l2Args.marketType;
l2Formatted['marketIndex'] = l2Args.marketIndex;