- deposit USDC, USDT, DAI, ARB, WBTC, FRAX or plvGLP
- 1 click loop using the underlying (or USDC in the case of plvGLP) up to 1 < desired leverage amount < 3
- start with
x
token, with desired leverage amounty
where10000 < y <= 30000
- flashloan
z
token, wherez = (y - 10000) * x
from balancerV2 vault 3a. if using plvGLP, mint plvGLP using USDC 3b. mint lToken using borrowed token through lodestar - transfer lToken to user
- call
lToken.borrowFor
to borrowz
token - transfer
z
token from user to balancer vault, paying back flashloan
- IERC20
_token
: The token you wish to loop - uint256
_amount
: The amount you wish to leverage - uint16
_leverage
: The amount at which you wish to leverage up to (10000, 20000, 30000 = 1, 2, 3) - uint16
_useWalletBalance
: A flag used to indicate whether the user wishes to use their wallet balance (1) or not (0)
User needs to action approvals:
- Approve Loopy to spend at least
_amount
plvGLP, for looping - Approve Loopy to spend at least
z
USDC, to repay flash loan - Approve Loopy to spend at least the lToken amount they with to leverage to.