- loop USDC, USDC.e, 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
- user has 0 ARB in their wallet, but wants to add to an existing ARB position on Lodestar and loop it 2x
- Lodestar starting supply balance: 1 ARB, no other assets
- Lodestar starting borrow balance: 0 ARB, no other assets
- Loop:
- token => ARB
- amount => 1
- leverage => 2x
- useWalletBalance => no
- Lodestar ending supply balance: 2 ARB
- Lodestar ending borrow balance: 1 ARB
- the user has successfully brought their existing 1 ARB position up 2x to 2 ARB, and as a result is now carrying a borrow balance of 1 ARB in addition to the 1 ARB added to their supply balance. they did not have to supply any further assets from their wallet to do so (although they had the option to).
- user has 1 USDC in their wallet and wants to add to an existing USDC position on Lodestar and loop it 2x
- Lodestar starting supply balance: 1 USDC, no other assets
- Lodestar starting borrow balance: 0 USDC, no other assets
- Loop:
- token => USDC
- amount => 1
- leverage => 2x
- useWalletBalance => yes
- Lodestar ending supply balance: 3 USDC
- Lodestar ending borrow balance: 1 USDC
- the user has successfully brought their freshly transferred in 1 USDC position up 2x to 2 USDC, and as a result is now carrying a borrow balance of 1 USDC in addition to the 2 USDC added to their supply balance. 2 USDC was added to the supply balance because the protocol took one from the users wallet, and leveraged it accordingly. since they opted to select useWalletBalance, the protocol took the 1 USDC they dictated, leveraged it 2x up to 2 USDC, and as a result is leaving the user with 3 USDC supplied on the protocol and 1 USDC borrowed.
- user has 1 USDT in their wallet and wants to create a new position on Lodestar and loop it 3x
- Lodestar starting supply balance: 0 USDT, no other assets
- Lodestar starting borrow balance: 0 USDT, no other assets
- Loop:
- token => USDT
- amount => 1
- leverage => 3x
- useWalletBalance => yes
- Lodestar ending supply balance: 3 USDT
- Lodestar ending borrow balance: 2 USDT
- the user has successfully brought their freshly transferred in 1 USDT position up 3x to 3 USDT, and as a result is now carrying a borrow balance of 2 USDT in addition to the 2 USDT added to their supply balance. 3 USDT was added to the supply balance because the protocol took one from the users wallet, and leveraged it accordingly. since they opted to select useWalletBalance, the protocol took the 1 USDT they dictated, leveraged it 3x up to 3 USDT, and as a result is leaving the user with 3 USDT supplied on the protocol and 2 USDT borrowed.
- to fill in
- 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)
The Lodestar dapp will handle all of the approvals and prompt you accordingly. In general, the 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.