Skip to content

Commit

Permalink
sdk: fix bn bug (#543)
Browse files Browse the repository at this point in the history
* sdk: fix bn bug

* update changelog
  • Loading branch information
lowkeynicc committed Jul 19, 2023
1 parent c6056d5 commit c53fbf8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixes

- ts-sdk: fix abs for dustBaseAssetValue in getPerpPositionWithLPSettle (#543)

### Breaking

- ts-sdk: account for lp shares in liq price ([#522](https://github.com/drift-labs/protocol-v2/pull/522))
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ export class User {
const oraclePriceData = this.driftClient.getOracleDataForPerpMarket(
position.marketIndex
);
dustBaseAssetValue = BN.abs(position.remainderBaseAssetAmount)
dustBaseAssetValue = new BN(Math.abs(position.remainderBaseAssetAmount))
.mul(oraclePriceData.price)
.div(AMM_RESERVE_PRECISION)
.add(ONE);
Expand Down

0 comments on commit c53fbf8

Please sign in to comment.