@defisaver/positions-sdk 2.0.15-dev-2 → 2.0.15-dev-3
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/cjs/staking/staking.js
CHANGED
|
@@ -172,11 +172,11 @@ const calculateNetApy = ({ usedAssets, assetsData, }) => {
|
|
|
172
172
|
if (eligibilityCheck) {
|
|
173
173
|
const { isEligible, eligibleUSDAmount } = eligibilityCheck(usedAssets);
|
|
174
174
|
const incentiveInterest = isEligible ? (0, exports.calculateInterestEarned)(eligibleUSDAmount, apy, 'year', true) : '0';
|
|
175
|
-
acc.incentiveUsd = new decimal_js_1.default(acc.incentiveUsd).
|
|
175
|
+
acc.incentiveUsd = new decimal_js_1.default(acc.incentiveUsd).add(incentiveInterest).toString();
|
|
176
176
|
}
|
|
177
177
|
else {
|
|
178
178
|
const incentiveInterest = (0, exports.calculateInterestEarned)(amount, apy, 'year', true);
|
|
179
|
-
acc.incentiveUsd = new decimal_js_1.default(acc.incentiveUsd).
|
|
179
|
+
acc.incentiveUsd = new decimal_js_1.default(acc.incentiveUsd).add(incentiveInterest).toString();
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
}
|
package/esm/staking/staking.js
CHANGED
|
@@ -165,11 +165,11 @@ export const calculateNetApy = ({ usedAssets, assetsData, }) => {
|
|
|
165
165
|
if (eligibilityCheck) {
|
|
166
166
|
const { isEligible, eligibleUSDAmount } = eligibilityCheck(usedAssets);
|
|
167
167
|
const incentiveInterest = isEligible ? calculateInterestEarned(eligibleUSDAmount, apy, 'year', true) : '0';
|
|
168
|
-
acc.incentiveUsd = new Dec(acc.incentiveUsd).
|
|
168
|
+
acc.incentiveUsd = new Dec(acc.incentiveUsd).add(incentiveInterest).toString();
|
|
169
169
|
}
|
|
170
170
|
else {
|
|
171
171
|
const incentiveInterest = calculateInterestEarned(amount, apy, 'year', true);
|
|
172
|
-
acc.incentiveUsd = new Dec(acc.incentiveUsd).
|
|
172
|
+
acc.incentiveUsd = new Dec(acc.incentiveUsd).add(incentiveInterest).toString();
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
}
|
package/package.json
CHANGED
package/src/staking/staking.ts
CHANGED
|
@@ -145,10 +145,10 @@ export const calculateNetApy = ({
|
|
|
145
145
|
if (eligibilityCheck) {
|
|
146
146
|
const { isEligible, eligibleUSDAmount } = eligibilityCheck(usedAssets);
|
|
147
147
|
const incentiveInterest = isEligible ? calculateInterestEarned(eligibleUSDAmount, apy, 'year', true) : '0';
|
|
148
|
-
acc.incentiveUsd = new Dec(acc.incentiveUsd).
|
|
148
|
+
acc.incentiveUsd = new Dec(acc.incentiveUsd).add(incentiveInterest).toString();
|
|
149
149
|
} else {
|
|
150
150
|
const incentiveInterest = calculateInterestEarned(amount, apy, 'year', true);
|
|
151
|
-
acc.incentiveUsd = new Dec(acc.incentiveUsd).
|
|
151
|
+
acc.incentiveUsd = new Dec(acc.incentiveUsd).add(incentiveInterest).toString();
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
}
|