@drift-labs/vaults-sdk 0.6.20 → 0.6.22

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.
@@ -29,7 +29,7 @@ class VaultDepositorAccount extends vaultsProgramAccount_1.VaultsProgramAccount
29
29
  const profit = depositorEquity
30
30
  .sub(accountData.netDeposits)
31
31
  .sub(accountData.cumulativeProfitShareAmount);
32
- if (profit.lte(new sdk_1.BN(0))) {
32
+ if (profit.lte(new sdk_1.BN(0)) || depositorEquity.isZero()) {
33
33
  return sdk_1.ZERO;
34
34
  }
35
35
  const profitShareAmount = profit
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drift-labs/vaults-sdk",
3
- "version": "0.6.20",
3
+ "version": "0.6.22",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "directories": {
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "dependencies": {
10
10
  "@coral-xyz/anchor": "0.29.0",
11
- "@drift-labs/sdk": "2.118.0-beta.2",
11
+ "@drift-labs/sdk": "2.118.0-beta.3",
12
12
  "@metaplex-foundation/js": "0.20.1",
13
13
  "@solana/web3.js": "1.92.3",
14
14
  "commander": "11.1.0",
@@ -56,7 +56,7 @@ export class VaultDepositorAccount extends VaultsProgramAccount<
56
56
  .sub(accountData.netDeposits)
57
57
  .sub(accountData.cumulativeProfitShareAmount);
58
58
 
59
- if (profit.lte(new BN(0))) {
59
+ if (profit.lte(new BN(0)) || depositorEquity.isZero()) {
60
60
  return ZERO;
61
61
  }
62
62