Morphine Docs
Comment on page

Sub Account

Actif Management
  • Composable Leverage:Morphine sub-accounts allow users to leverage their assets between 12x and 15x, providing them with more significant borrowing power. This feature enables borrowers to take advantage of opportunities in the DeFi market while managing their risk exposure.
  • On-chain automation : One of the key features of sub-accounts is the ability to automate various investment and risk management strategies. This automation enables borrowers to optimize their positions, manage risks, and take advantage of opportunities in the DeFi space without constant manual intervention.
  • Flexible and secure management: You can manage manually your holdings from our intuitive interface or our from our SDK. All interactions with DeFi is performed through our adapters, ensuring safe transactions.

Weighted Collateral

Morphine allows you to borrow assets from any available pools providing collaterals (Tokens, LP, ERC4626, LSD). If your collateral can't cover your debt anymore, you'll probably get liquidated.
To protect pool from loss, user collateral is weighted for 2 reasons:
  • The liquidation comes with fees, a premium for the liquidator and an other part for the protocol. Thus, we need to take into account those fees in the value of user collaterals.
  • The collateral can be different from the user debt token. A very volatile asset (against the debt token) could rapidly lose in value and create an insolvency and thus a loss for the pool
Liquidation Threshold = 1 - ( liquidation premium + liquidation fees + volatility of the asset against the debt token)
You always need to make sure you have enough collateral to cover your loan: the health factor is a good index to estimate your collateral ratio.
Hf=TotalWeightedValueBorrowedAmountPlusInterestAndFeesH_f ={\frac{TotalWeightedValue}{BorrowedAmountPlusInterestAndFees}}
  • The total weighted value is the sum of each assets owned in the sub acccount, multiplied by their liquidation threshold.
  • The liquidation Threshold, used to protect pools from loss. These parameters are set by the governance, and accessible on the pool page.
  • Interest fees is set by the governance, and accessible on the pool page.
You need to keep your sub acount healthy or you could get liquidated

Borrow Power

Health factor > 1 => liq threshold collateral x (collateral amount + Borrow ) > Borrow =>
LiqThreshold1−LiqThreshold∗collateral>Borrow{\frac{Liq Threshold}{1 - Liq Threshold}} * collateral > Borrow
Let's say you are deposing 100 DAI as collateral and the pool charges 2% liquidation fees and 1% liquidation premium. You'll be able to borrow 3233.3 Dai maximum. This exemple is using the Debt token as collateral token, keep in mind that it is usually counter productive to borrow debt token (except arbitrage strategies for under collateralised market) and that other tokens always have lower liquidation thresholds.


You can set automation task inside your sub account. You'll have to provide the following:
  • The task condtion (Token price, Health factor, token allocation weight)
  • The desired token basket ( 100% debt token, a certain index)
  • The bonus for the trader (0.1 to 1%)
Once the condition is met, anyone can perform a multicall on your sub account, that will passed only if the conditions are respected.


Let's say Joe has a 5x position stETH / DAI. He wants to protect his sub account from liquidation because he doesn't want to pay additional fees.
He sends the task to his subaccount:
  • Condition HealthFactor < 1.01
  • Desired token basket : full DAI
  • Bonus : 0.5%
ETH is going down, his health factor goes below 1.01, he owns 100k$ of stETH .
Current basket of asset : 100% stETH, 100k$ value
Desired basket of asset: 100% DAI, 100k* (100-0,5) = 99500$ of DAI
  • Mike trade stETH to ETH and then ETH to DAI for a 200$ loss, he will withdraw 300$ of DAI as a premium. Profit: 300$ less transfer fees
  • Billy enable DAI on Joe sub account, send him 99500$ DAI, and withdraw 100k$ of stETH. Profit 500$ less transfer fees