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

Use shares instead of assets to repay max #591

Open
MerlinEgalite opened this issue Jan 24, 2024 · 1 comment
Open

Use shares instead of assets to repay max #591

MerlinEgalite opened this issue Jan 24, 2024 · 1 comment

Comments

@MerlinEgalite
Copy link

morphoBlue.repay(paybackData.marketParams, paybackData.amount, 0, onBehalf, bytes(""));

Using assets to repay the full debt can leave some shares on the protocol and thus no entirely close the position.

See this snippet as example:
https://github.com/morpho-org/morpho-blue-snippets/blob/190ced2d6cee553e4fd117e4fc3adf7ab3e6b4fb/src/morpho-blue/MorphoBlueSnippets.sol#L377-L383

@Jean-Grimal
Copy link

Yes I would recommend to use the shares input to repay all when paybackData.paybackAll == true.

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

No branches or pull requests

2 participants