@drift-labs/sdk 2.84.0-beta.4 → 2.84.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/VERSION +1 -1
- package/lib/dlob/orderBookLevels.js +4 -1
- package/package.json +1 -1
- package/src/dlob/orderBookLevels.ts +14 -5
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.84.0-beta.
|
|
1
|
+
2.84.0-beta.5
|
|
@@ -92,7 +92,10 @@ function getVammL2Generator({ marketAccount, oraclePriceData, numOrders, now, to
|
|
|
92
92
|
(0, assert_1.assert)(topOfBookQuoteAmounts.length < numOrders);
|
|
93
93
|
}
|
|
94
94
|
const updatedAmm = (0, __1.calculateUpdatedAMM)(marketAccount.amm, oraclePriceData);
|
|
95
|
-
|
|
95
|
+
const vammFillsDisabled = (0, __1.isOperationPaused)(marketAccount.pausedOperations, __1.PerpOperation.AMM_FILL);
|
|
96
|
+
let [openBids, openAsks] = vammFillsDisabled
|
|
97
|
+
? [__1.ZERO, __1.ZERO]
|
|
98
|
+
: (0, __1.calculateMarketOpenBidAsk)(updatedAmm.baseAssetReserve, updatedAmm.minBaseAssetReserve, updatedAmm.maxBaseAssetReserve, updatedAmm.orderStepSize);
|
|
96
99
|
const minOrderSize = marketAccount.amm.minOrderSize;
|
|
97
100
|
if (openBids.lt(minOrderSize.muln(2))) {
|
|
98
101
|
openBids = __1.ZERO;
|
package/package.json
CHANGED
|
@@ -7,9 +7,11 @@ import {
|
|
|
7
7
|
calculateSpreadReserves,
|
|
8
8
|
calculateUpdatedAMM,
|
|
9
9
|
DLOBNode,
|
|
10
|
+
isOperationPaused,
|
|
10
11
|
isVariant,
|
|
11
12
|
OraclePriceData,
|
|
12
13
|
PerpMarketAccount,
|
|
14
|
+
PerpOperation,
|
|
13
15
|
PositionDirection,
|
|
14
16
|
QUOTE_PRECISION,
|
|
15
17
|
standardizePrice,
|
|
@@ -167,13 +169,20 @@ export function getVammL2Generator({
|
|
|
167
169
|
|
|
168
170
|
const updatedAmm = calculateUpdatedAMM(marketAccount.amm, oraclePriceData);
|
|
169
171
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
updatedAmm.maxBaseAssetReserve,
|
|
174
|
-
updatedAmm.orderStepSize
|
|
172
|
+
const vammFillsDisabled = isOperationPaused(
|
|
173
|
+
marketAccount.pausedOperations,
|
|
174
|
+
PerpOperation.AMM_FILL
|
|
175
175
|
);
|
|
176
176
|
|
|
177
|
+
let [openBids, openAsks] = vammFillsDisabled
|
|
178
|
+
? [ZERO, ZERO]
|
|
179
|
+
: calculateMarketOpenBidAsk(
|
|
180
|
+
updatedAmm.baseAssetReserve,
|
|
181
|
+
updatedAmm.minBaseAssetReserve,
|
|
182
|
+
updatedAmm.maxBaseAssetReserve,
|
|
183
|
+
updatedAmm.orderStepSize
|
|
184
|
+
);
|
|
185
|
+
|
|
177
186
|
const minOrderSize = marketAccount.amm.minOrderSize;
|
|
178
187
|
if (openBids.lt(minOrderSize.muln(2))) {
|
|
179
188
|
openBids = ZERO;
|