To open position:
- use flashloan to get debtAsset
- swap debtAsset to yieldAsset
- supply yieldAsset
- borrow debtAsset to repay flashloan
To close position:
- use flashloan to get debtAsset
- repay debt
- withdraw yieldAsset
- swap yieldAsset to debtAsset
- repay flashloan
Users must approve:
Looping
contract to spend the initial amount ofdebtAsset
Looping
contract to spendVariableDebtToken
ofdebtAsset
(usingapproveDelegation
, so contract can borrow on behalf of the user).
Positions Manager keeps track of different leveraged positions.