weight = 50%
deposit wstETH
- provide 50% of wstETH into liquidity range [current_price, current_price*priceScalingFactor]
- collateral 50% of wstETH on Morpho pool
withdraw wstETH
- close uniswap position into wstETH and USDC
- swap all oSQTH into wstETH
- repay borrow on Morpho using USDC (extra usdc could be bought with wstETH)
- withdraw wstETH from Morpho
- swap USDC (if remained) into wstETH and transfer all wstETH to user
swap: price go up
- borrow USDC = delta_amount1 from Morpho
- swap this USDC into oSQTH
swap: price go down
- swap oSQTH into USDC = delta_amount1
- use this USDC to repay on Morpho pool
weight = 50% cRatio = 50%
deposit USDC
- provide 50% of USDC into liquidity range [current_price/priceScalingFactor, current_price]
- collateral 50% of USDC on Morpho pool
withdraw USDC
- close uniswap position into wstETH and USDC
- calculate amounts to repay on Morpho pool (target_wstETH) and Squeeth (target_oSQTH)
- insure balance of oSQTH = target_oSQTH
- burn oSQTH position and get ETH collateral back
- swap all ETH into USDC
- insure balance of wstETH = target_wstETH
- repay borrow on Morpho using wstETH
- withdraw USDC from Morpho and transfer all wstETH to user
swap: price go down
- borrow wstETH = delta_amount0 from Morpho
- swap wstETH into ETH
- provide this ETH into collateral on Squeeth
- mint oSQTH using cRatio percent of new collateral added
- swap all new oSQTH into USDC
swap: price go up
- swap USDC = delta_amount1 into oSQTH
- burn oSQTH position and get cRatio percent of collateral back
- swap ETH into wstETH
- repay on Morpho pool using this wstETH
Test all project
make test_all
Test call option
make test_call
or put option
make test_put
You could go into the brevisCircuit folder to deploy, test and use the Brevis circuit contract on Sepolia testnet.