serum-vial
Advanced tools
Comparing version 0.9.6 to 0.9.7
@@ -14,3 +14,3 @@ import { Market } from '@project-serum/serum'; | ||
private _lastSeenSeqNum; | ||
private _lastL3DiffWasInvalid; | ||
private _invalidSubsequentL3DiffsCount; | ||
private _currentL2Snapshot; | ||
@@ -17,0 +17,0 @@ private _currentQuote; |
@@ -20,3 +20,3 @@ "use strict"; | ||
this._lastSeenSeqNum = undefined; | ||
this._lastL3DiffWasInvalid = false; | ||
this._invalidSubsequentL3DiffsCount = 0; | ||
this._currentL2Snapshot = undefined; | ||
@@ -108,3 +108,3 @@ this._currentQuote = undefined; | ||
const diffIsValid = this._validateL3DiffCorrectness(l3Diff); | ||
if (diffIsValid === false && this._lastL3DiffWasInvalid) { | ||
if (diffIsValid === false && this._invalidSubsequentL3DiffsCount >= 2) { | ||
logger_1.logger.log('warn', 'Resetting data mapper state due to invalid l3diff', { | ||
@@ -120,3 +120,8 @@ market: this._options.symbol, | ||
} | ||
this._lastL3DiffWasInvalid = diffIsValid === false; | ||
if (diffIsValid == false) { | ||
this._invalidSubsequentL3DiffsCount++; | ||
} | ||
else { | ||
this._invalidSubsequentL3DiffsCount = 0; | ||
} | ||
} | ||
@@ -290,3 +295,3 @@ // initialize only when we have both asks and bids accounts data | ||
this._currentQuote = undefined; | ||
this._lastL3DiffWasInvalid = false; | ||
this._invalidSubsequentL3DiffsCount = 0; | ||
} | ||
@@ -293,0 +298,0 @@ _validateL3DiffCorrectness(l3Diff) { |
{ | ||
"name": "serum-vial", | ||
"version": "0.9.6", | ||
"version": "0.9.7", | ||
"engines": { | ||
@@ -5,0 +5,0 @@ "node": ">=15" |
@@ -39,3 +39,3 @@ import { EVENT_QUEUE_LAYOUT, Market, Orderbook, getLayoutVersion } from '@project-serum/serum' | ||
private _lastSeenSeqNum: number | undefined = undefined | ||
private _lastL3DiffWasInvalid = false | ||
private _invalidSubsequentL3DiffsCount = 0 | ||
@@ -143,3 +143,3 @@ private _currentL2Snapshot: | ||
if (diffIsValid === false && this._lastL3DiffWasInvalid) { | ||
if (diffIsValid === false && this._invalidSubsequentL3DiffsCount >= 2) { | ||
logger.log('warn', 'Resetting data mapper state due to invalid l3diff', { | ||
@@ -155,4 +155,7 @@ market: this._options.symbol, | ||
} | ||
this._lastL3DiffWasInvalid = diffIsValid === false | ||
if (diffIsValid == false) { | ||
this._invalidSubsequentL3DiffsCount++ | ||
} else { | ||
this._invalidSubsequentL3DiffsCount = 0 | ||
} | ||
} | ||
@@ -375,3 +378,3 @@ | ||
this._currentQuote = undefined | ||
this._lastL3DiffWasInvalid = false | ||
this._invalidSubsequentL3DiffsCount = 0 | ||
} | ||
@@ -378,0 +381,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
268034
3958