Skip to content

Commit

Permalink
add README
Browse files Browse the repository at this point in the history
  • Loading branch information
0xdapper committed Mar 13, 2023
1 parent 4b55956 commit f8ef52e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# aave-unwind

[`Unwind.sol`](./src/Unwind.sol) can be used by users to unwind their levered
positions by:
1. Flashloaning the debt/borrowed asset from Balancer/Aave-v3.
2. Repaying the debt with the flashloaned assets.
3. Withdrawing the freed up collateral.
4. Dumping the freed collateral for debt asset.
5. Repaying the flashloan from the swapped collateral.

This allows users to unwind their levered positions without looping through
number of withdraw collateral, swap, repay debt transaction cycles by utilizing
flashloans.

Note: Users have to approve their collateral aToken to the contract so it can
`tranferFrom` the user and withdraw the collateral.

At the end of `Unwind.unwind` transaction all the remainder collateral and debt
token assets are returned back to the user.

0 comments on commit f8ef52e

Please sign in to comment.