Skip to content

Commit

Permalink
Merge pull request #31 from Jeff-CCH/fix/repay-tolerance
Browse files Browse the repository at this point in the history
fix: change repay tolerance of aave v2, aave v3, radiant v2 and spark
  • Loading branch information
Jeff-CCH authored Dec 20, 2023
2 parents 991a2ef + 01bfa22 commit 7d15b63
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/four-crabs-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@protocolink/logics': patch
---

change repay tolerance of aave v2, aave v3, radiant v2 and spark
2 changes: 1 addition & 1 deletion src/logics/aave-v2/logic.repay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class RepayLogic
borrower
);
const currentDebt = interestRateMode === InterestRateMode.variable ? currentVariableDebt : currentStableDebt;
const amountWei = common.calcSlippage(currentDebt, -100); // slightly higher than the current borrowed amount
const amountWei = common.calcSlippage(currentDebt, -1); // slightly higher than the current borrowed amount
const input = new common.TokenAmount(tokenIn).setWei(amountWei);

return { borrower, interestRateMode, input };
Expand Down
2 changes: 1 addition & 1 deletion src/logics/aave-v3/logic.repay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class RepayLogic
borrower
);
const currentDebt = interestRateMode === InterestRateMode.variable ? currentVariableDebt : currentStableDebt;
const amountWei = common.calcSlippage(currentDebt, -100); // slightly higher than the current borrowed amount
const amountWei = common.calcSlippage(currentDebt, -1); // slightly higher than the current borrowed amount
const input = new common.TokenAmount(tokenIn).setWei(amountWei);

return { borrower, interestRateMode, input };
Expand Down
2 changes: 1 addition & 1 deletion src/logics/radiant-v2/logic.repay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class RepayLogic
borrower
);
const currentDebt = interestRateMode === InterestRateMode.variable ? currentVariableDebt : currentStableDebt;
const amountWei = common.calcSlippage(currentDebt, -100); // slightly higher than the current borrowed amount
const amountWei = common.calcSlippage(currentDebt, -1); // slightly higher than the current borrowed amount
const input = new common.TokenAmount(tokenIn).setWei(amountWei);

return { borrower, interestRateMode, input };
Expand Down
2 changes: 1 addition & 1 deletion src/logics/spark/logic.repay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class RepayLogic
borrower
);
const currentDebt = interestRateMode === InterestRateMode.variable ? currentVariableDebt : currentStableDebt;
const amountWei = common.calcSlippage(currentDebt, -100); // slightly higher than the current borrowed amount
const amountWei = common.calcSlippage(currentDebt, -1); // slightly higher than the current borrowed amount
const input = new common.TokenAmount(tokenIn).setWei(amountWei);

return { borrower, interestRateMode, input };
Expand Down

0 comments on commit 7d15b63

Please sign in to comment.