Skip to content

Commit

Permalink
bigz/sdk-fix-getL2Asks (#708)
Browse files Browse the repository at this point in the history
* bigz/sdk-fix-getL2Asks

* rm logs

* update changelog
  • Loading branch information
0xbigz authored Nov 21, 2023
1 parent cd2f329 commit 8e3dd04
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Features

### Fixes
- sdk: fix vamm L2asks by using askAmm ([#708](https://github.com/drift-labs/protocol-v2/pull/708))

### Breaking

Expand Down
6 changes: 3 additions & 3 deletions sdk/src/dlob/orderBookLevels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,15 +302,15 @@ export function getVammL2Generator({
baseSwapped = remainingBaseLiquidity;
[afterSwapQuoteReserves, afterSwapBaseReserves] =
calculateAmmReservesAfterSwap(
bidAmm,
askAmm,
'base',
baseSwapped,
SwapDirection.REMOVE
);

quoteSwapped = calculateQuoteAssetAmountSwapped(
bidAmm.quoteAssetReserve.sub(afterSwapQuoteReserves).abs(),
bidAmm.pegMultiplier,
askAmm.quoteAssetReserve.sub(afterSwapQuoteReserves).abs(),
askAmm.pegMultiplier,
SwapDirection.REMOVE
);
}
Expand Down

0 comments on commit 8e3dd04

Please sign in to comment.