Skip to main content

The FlashLeverage mechanism

Instead of the old deposit-borrow-swap-deposit-borrow-swap loop that costs a ton of gas and exposes you to price risk between steps, everything happens in one flash-loan transaction. When you open a position, the protocol flash-loans the desired borrow amount from Morpho, swaps it all to the collateral token through a whitelisted swap router, combines it with your deposit, supplies the total as collateral to Morpho on your isolated UserProxy, borrows against it to repay the flash loan, and you’re done. One block, one transaction. Closing works in reverse. Flash-loan to repay the debt, withdraw all collateral, swap back to the loan token, repay the flash loan from the swap proceeds, take fees from the profit (if any), and send you the rest.

Working example

Say you deposit 10,000 USDC worth of sUSDe and want 3x leverage. sUSDe is earning around 12% APY, and borrowing on Morpho costs 4%. The protocol flash-loans 20,000 USDC, swaps it to sUSDe, combines with your 10,000 deposit for 30,000 total collateral on Morpho, and borrows 20,000 USDC against it to repay the flash loan. Your annualized numbers look like this. 30,000 in collateral earning 12% gives you 3,600. Subtract the 800 in borrowing costs (20,000 at 4%). That’s 2,800 net profit on a 10,000 deposit, or 28% before fees. After the 10% yield fee on the 2,800 profit, you net about 25.2%. Compare that to base 12% APY without 3x leverage.

Position lifecycle

Once a position is open, you have several options. You can increase leverage by flash-loaning more and adding to your collateral. You can supply additional collateral to bring your LTV down. You can repay some of your debt. You can borrow against your collateral or withdraw some of it, as long as you stay within LTV limits. When you’re ready to exit, deleverage closes everything atomically. If that’s not possible because of missing swap routes, You can always unwind your position by withdrawing some collateral, unstake it for loan token, payback more loan to withdraw more collateral and repeat this until you fully close your position.