@aurigami/sdk 1.6.3 → 1.6.4

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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.6.3",
2
+ "version": "1.6.4",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -53,9 +53,12 @@ export function calcLMRewardApr(
53
53
  totalStakeValue: BigNumber,
54
54
  frequencyPerYear: number
55
55
  ): BigNumber {
56
+ if (rewardsValue.isZero()) {
57
+ return new BigNumber(0);
58
+ }
56
59
  if (totalStakeValue.lte(0)) {
57
60
  // avoid division by zero when there is no stake
58
- return new BigNumber('999999999');
61
+ return rewardsValue;
59
62
  }
60
63
  return rewardsValue.multipliedBy(frequencyPerYear).dividedBy(totalStakeValue);
61
64
  }