Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support same asset repay #314

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

defispartan
Copy link

@defispartan defispartan commented Oct 10, 2022

Extension of #222 which is the version currently deployed to the Aave interface

Adds condition to allow for repay with collateral when aToken and debtToken have the same underlying asset:

Old

    uint256 amountSold =
      _buyOnParaSwap(
        buyAllBalanceOffset,
        paraswapData,
        collateralAsset,
        debtAsset,
        collateralAmount,
        debtRepayAmount
      );

New

   uint256 amountSold = debtRepayAmount;

    if (collateralAsset != debtAsset) {
      amountSold = _buyOnParaSwap(
        buyAllBalanceOffset,
        paraswapData,
        collateralAsset,
        debtAsset,
        collateralAmount,
        debtRepayAmount
      );
    }

Copy link
Contributor

@kartojal kartojal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you delete the Yarn file? this is a NPM project and I would prevent to have both package-lock and yarn lock in the same project to prevent different dependencies between contributors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants