Beyond Marginly v1

This page describes team's vision on future protocol enhancements

The current version of Marginly described in this document is v1. Even though it is sophisticated enough and handles risks responsibly, there is still a lot of room for improvement.

The dev team continues its active research on the future of the DeFi and aims to introduce the v2 version of the Marginly protocol, which will include the following features:

  • Deleveraging: auto-deleverage risky positions to avoid liquidations.

  • Option strategies: Introduce option-based strategies using Uniswap position exposure.

  • Multiple liquidity sources: Connect other sources of Liquidity, such as Curve’s tri-crypto pool for leveraged trading. Introduce smart routing and smart liquidity management.

Let's elaborate on each of the points in detail:


Deleveraging reduces one's leverage (collateral and debt) when the system has a liquidity shortage.

Liquidity may be absent in the system in the following cases:

  • The lender (liquidity provider) wants to withdraw, and there is no liquidity as all of it was borrowed.

  • The protocol needs to liquidate the borrower, and there is no collateral to sell as all of it was borrowed.

The second case may be reduced to the first case if the receive_position() method is called, and the position receiver reduces the entire liquidating position debt are several possible approaches to the problem of liquidity shortage in the system. Some try to avoid it altogether, others introduce ways to correct it when it has already happened, while both could benefit from additional market-driven interest rate mechanics such as utilization-based interest rate curves commonly seen in classical DeFi lending protocols. We envision the following possibilities for improvements in newer versions of Marginly:

  1. Introduce a reserve ratio to limit the amount of liquidity that may be taken out of the system: with such an approach, there could never be a situation when the entire collateral has been borrowed as debt because there will always be a fraction left governed by the magnitude of the reserve ratio. Potential bank runs still have to be accounted for, though, as the reserve ratio doesn’t solve the problem completely but rather mitigates it.

  2. Do honest deleverage when liquidating positions. Modify collateral and debt coefficients of the opposite side in the system, effectively reducing the overall long or short system leverage. This approach appeals to its simplicity. One alternative option is to de-lever consecutively, starting with the riskiest position first and moving down the leverage heap.

  3. Target a certain long/short ratio in the system, which is the ratio of total USDC debt value (longs) to the total WETH debt value (shorts). So one could imagine a system that penalizes or deleverages the long side when the ratio is above one and deleverages shorts when the ratio is below one.

Multiple liquidity sources

Liquidity risk is one of the main risks with which investors are concerned. What happens to the system in the absence of external liquidity sources? How are risky positions being liquidated in such cases? What are other liquidity options besides Uniswap pools? These are examples of essential questions that we will have to find answers to in future versions of the Marginly protocol.

When there is more than one pool available to choose from, there arises the need to build a logic that would identify which pool is best to use, given current liquidity conditions and immediate trade parameters. So-called routers best perform these tasks. One example of such a router is the 1inch’s router. We plan to use such routers in future versions of the Marginly protocol and might even consider building one of our own.

Option strategies

One way to think about a Uniswap liquidity position is as a covered call or a short cash-secured put option strategy, depending on whether the strike tick had been above or below the current spot price when liquidity was deployed.

Overall, Uniswap liquidity positions are a combination of long positions in two tokens and short options (either calls or puts) on those tokens. The trading fee revenue earned by liquidity providers can be thought of as the premium received for selling those options. Armed with this knowledge, we can create short straddle or short strangle option positions:

  • Short Straddle: Deploy 2 x ETH liquidity to the single tick as close to the current market price as possible, then sell 1 x ETH on the market.

  • Short Strangle: Deploy USDC liquidity in a range below the current market price and deploy ETH liquidity in a range above the current market price, then sell the same amount of ETH elsewhere in a separate transaction.

In future versions of the Marginly protocol, we are going to exploit the above knowledge to offer users the delta-neutral option strategies described above, which help control directional biases of their portfolios.

Last updated