@drift-labs/sdk 2.121.0-beta.16 → 2.121.0-beta.18
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
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.121.0-beta.
|
|
1
|
+
2.121.0-beta.18
|
|
@@ -128,7 +128,7 @@ function getVammL2Generator({ marketAccount, oraclePriceData, numOrders, now, to
|
|
|
128
128
|
quoteSwapped = topOfBookQuoteAmounts[numBids];
|
|
129
129
|
[afterSwapQuoteReserves, afterSwapBaseReserves] =
|
|
130
130
|
(0, __1.calculateAmmReservesAfterSwap)(bidAmm, 'quote', quoteSwapped, __1.SwapDirection.REMOVE);
|
|
131
|
-
(0, __1.standardizeBaseAssetAmount)(bidAmm.baseAssetReserve.sub(afterSwapBaseReserves).abs(), marketAccount.amm.orderStepSize);
|
|
131
|
+
baseSwapped = (0, __1.standardizeBaseAssetAmount)(bidAmm.baseAssetReserve.sub(afterSwapBaseReserves).abs(), marketAccount.amm.orderStepSize);
|
|
132
132
|
if (baseSwapped.eq(__1.ZERO)) {
|
|
133
133
|
return;
|
|
134
134
|
}
|
|
@@ -198,7 +198,7 @@ function getVammL2Generator({ marketAccount, oraclePriceData, numOrders, now, to
|
|
|
198
198
|
else {
|
|
199
199
|
baseSwapped = (0, __1.standardizeBaseAssetAmount)(askSize, marketAccount.amm.orderStepSize);
|
|
200
200
|
[afterSwapQuoteReserves, afterSwapBaseReserves] =
|
|
201
|
-
(0, __1.calculateAmmReservesAfterSwap)(askAmm, 'base',
|
|
201
|
+
(0, __1.calculateAmmReservesAfterSwap)(askAmm, 'base', baseSwapped, __1.SwapDirection.REMOVE);
|
|
202
202
|
quoteSwapped = (0, __1.calculateQuoteAssetAmountSwapped)(askAmm.quoteAssetReserve.sub(afterSwapQuoteReserves).abs(), askAmm.pegMultiplier, __1.SwapDirection.REMOVE);
|
|
203
203
|
}
|
|
204
204
|
const price = (0, __1.standardizePrice)(quoteSwapped.mul(__1.BASE_PRECISION).div(baseSwapped), orderTickSize, __1.PositionDirection.SHORT);
|
|
@@ -128,7 +128,7 @@ function getVammL2Generator({ marketAccount, oraclePriceData, numOrders, now, to
|
|
|
128
128
|
quoteSwapped = topOfBookQuoteAmounts[numBids];
|
|
129
129
|
[afterSwapQuoteReserves, afterSwapBaseReserves] =
|
|
130
130
|
(0, __1.calculateAmmReservesAfterSwap)(bidAmm, 'quote', quoteSwapped, __1.SwapDirection.REMOVE);
|
|
131
|
-
(0, __1.standardizeBaseAssetAmount)(bidAmm.baseAssetReserve.sub(afterSwapBaseReserves).abs(), marketAccount.amm.orderStepSize);
|
|
131
|
+
baseSwapped = (0, __1.standardizeBaseAssetAmount)(bidAmm.baseAssetReserve.sub(afterSwapBaseReserves).abs(), marketAccount.amm.orderStepSize);
|
|
132
132
|
if (baseSwapped.eq(__1.ZERO)) {
|
|
133
133
|
return;
|
|
134
134
|
}
|
|
@@ -198,7 +198,7 @@ function getVammL2Generator({ marketAccount, oraclePriceData, numOrders, now, to
|
|
|
198
198
|
else {
|
|
199
199
|
baseSwapped = (0, __1.standardizeBaseAssetAmount)(askSize, marketAccount.amm.orderStepSize);
|
|
200
200
|
[afterSwapQuoteReserves, afterSwapBaseReserves] =
|
|
201
|
-
(0, __1.calculateAmmReservesAfterSwap)(askAmm, 'base',
|
|
201
|
+
(0, __1.calculateAmmReservesAfterSwap)(askAmm, 'base', baseSwapped, __1.SwapDirection.REMOVE);
|
|
202
202
|
quoteSwapped = (0, __1.calculateQuoteAssetAmountSwapped)(askAmm.quoteAssetReserve.sub(afterSwapQuoteReserves).abs(), askAmm.pegMultiplier, __1.SwapDirection.REMOVE);
|
|
203
203
|
}
|
|
204
204
|
const price = (0, __1.standardizePrice)(quoteSwapped.mul(__1.BASE_PRECISION).div(baseSwapped), orderTickSize, __1.PositionDirection.SHORT);
|
package/package.json
CHANGED
|
@@ -240,7 +240,7 @@ export function getVammL2Generator({
|
|
|
240
240
|
SwapDirection.REMOVE
|
|
241
241
|
);
|
|
242
242
|
|
|
243
|
-
standardizeBaseAssetAmount(
|
|
243
|
+
baseSwapped = standardizeBaseAssetAmount(
|
|
244
244
|
bidAmm.baseAssetReserve.sub(afterSwapBaseReserves).abs(),
|
|
245
245
|
marketAccount.amm.orderStepSize
|
|
246
246
|
);
|
|
@@ -370,7 +370,7 @@ export function getVammL2Generator({
|
|
|
370
370
|
calculateAmmReservesAfterSwap(
|
|
371
371
|
askAmm,
|
|
372
372
|
'base',
|
|
373
|
-
|
|
373
|
+
baseSwapped,
|
|
374
374
|
SwapDirection.REMOVE
|
|
375
375
|
);
|
|
376
376
|
|