Skip to content

Commit efa4819

Browse files
committed
tests: fix
1 parent ec7c14a commit efa4819

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

projects/vaults/test/InceptionVault_S_LBTC.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1409,11 +1409,11 @@ assets.forEach(function (a) {
14091409
if (_amount > 0n && fromUtilization <= utilization && utilization < toUtilization) {
14101410
const fromPercent = await feeFunc.fromPercent();
14111411
const toPercent = await feeFunc.toPercent();
1412-
const upperBound = (toUtilization * BigInt(1e8)) / MAX_PERCENT;
1412+
const upperBound = (toUtilization * targetCapacity) / MAX_PERCENT;
14131413
const replenished = upperBound > flashCapacity + _amount ? _amount : upperBound - flashCapacity;
14141414
const slope = ((toPercent - fromPercent) * MAX_PERCENT) / (toUtilization - fromUtilization);
14151415
const bonusPercent =
1416-
fromPercent + (slope * (flashCapacity + replenished / 2n)) / BigInt(1e8);
1416+
fromPercent + (slope * (flashCapacity + replenished / 2n)) / targetCapacity;
14171417
const bonus = (replenished * bonusPercent) / MAX_PERCENT;
14181418
console.log(`Replenished:\t\t\t${replenished.format()}`);
14191419
console.log(`Bonus percent:\t\t\t${bonusPercent.format()}`);
@@ -1621,11 +1621,11 @@ assets.forEach(function (a) {
16211621
console.log(`Utilization:\t\t\t${utilization.format()}`);
16221622
const fromPercent = await feeFunc.fromPercent();
16231623
const toPercent = await feeFunc.toPercent();
1624-
const lowerBound = (fromUtilization * BigInt(1e8)) / MAX_PERCENT;
1624+
const lowerBound = (fromUtilization * targetCapacity) / MAX_PERCENT;
16251625
const replenished = lowerBound > flashCapacity - _amount ? flashCapacity - lowerBound : _amount;
16261626
const slope = ((toPercent - fromPercent) * MAX_PERCENT) / (toUtilization - fromUtilization);
16271627
const withdrawFeePercent =
1628-
fromPercent + (slope * (flashCapacity - replenished / 2n)) / BigInt(1e8);
1628+
fromPercent + (slope * (flashCapacity - replenished / 2n)) / targetCapacity;
16291629
const fee = (replenished * withdrawFeePercent) / MAX_PERCENT;
16301630
console.log(`Replenished:\t\t\t${replenished.format()}`);
16311631
console.log(`Fee percent:\t\t\t${withdrawFeePercent.format()}`);

0 commit comments

Comments
 (0)