Skip to content

Commit

Permalink
sdk: fix calculateAssetWeight (#308)
Browse files Browse the repository at this point in the history
* fix sdk/src/math/spotBalance.ts

* update changelog.md
  • Loading branch information
0xbigz committed Dec 28, 2022
1 parent fddb2e6 commit 6d71566
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixes

- ts-sdk: fix deprecated calls to `@solana/web3.js` ([#299](https://github.com/drift-labs/protocol-v2/pull/307))
- ts-sdk: fix calculateAssetWeight for Maintenance Margin ([#308](https://github.com/drift-labs/protocol-v2/pull/308))

### Breaking

Expand Down
6 changes: 1 addition & 5 deletions sdk/src/math/spotBalance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,7 @@ export function calculateAssetWeight(
);
break;
case 'Maintenance':
assetWeight = calculateSizeDiscountAssetWeight(
sizeInAmmReservePrecision,
new BN(spotMarket.imfFactor),
new BN(spotMarket.maintenanceAssetWeight)
);
assetWeight = new BN(spotMarket.maintenanceAssetWeight);
break;
default:
assetWeight = new BN(spotMarket.initialAssetWeight);
Expand Down

0 comments on commit 6d71566

Please sign in to comment.