Margined CL MMing Vault

This document outlines the Margined Protocol (MP) CL MMing vault in response to the Strategic BTC Position for Enhanced Market Liquidity

This strategy would LP ±5% either side of the market price providing a number of key benefits over the static position suggested in the thread above.

  • Increased capital efficiency through tighter range
  • Improved pricing - through proactive position management
  • Increased impact of Osmosis treasury funds

In addition we provide an suggestion for the configuration of the positions and are open to further discussion on the strategy.

NOTE: We could deploy this strategy from 18/11/24 onwards.

Overview

MP has developed a CL MMing vault for Liquid Staked Derivatives (LSDs) but has extended it to be used in any market.

At a high level it works as follows:

  • gets spot (market) and external price (e.g. binance)
  • places bids and asks either side of spot and external prices

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

It has the ability to place different amounts of liquidity across the bids and asks, enabling small trades to have a good price but for large trades to to incur more slippage.

As prices move and liquidity is consumed it then repositions the inventory accordingly.

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

Above we see that liquidity is shifted as the external price moves past a threshold.

Using the spot and external prices as references from which to place limit orders we are able to ensure that assets are never sold below their market rate.

Further, by removing liquidity between bids and asks (at least during the initial phase) enables the spot and external price rate to converge. Note: this assumes the asset's price is set externally and not on-chain.

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

Over time the two positions should converge and a single sided position will be created in the middle. If positions have met in the middle then the liquidity should only be repositioned if:

  1. the spot and external price exceed either price threshold
  2. entire liquidity is consumed for the first level of bids/asks

If the price moves through liquidity then inventory will become imbalanced as shown below:

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

Imbalanced Inventory

As a LP MMing strategy some amount of inventory imbalance should be accepted. However, if the inventory becomes imbalanced past the inventory imbalance threshold

Ti additional spread is added to the side with reduced inventory.

This makes it less likely for liquidity to be consumed on that side, thus incentivising a gradual return to a balanced inventory.

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

Description

Margined's CL MMing strategy is configurable using the below:

Variable Definition Description
Sb
Spread bids Spread from top of book for bid orders
Sa
Spread asks. Spread from top of book for ask orders.
Nb
Number of bid orders Total count of active bid orders in the market
Na
Number of ask orders Total count of active ask orders in the market
Lb
Liquidity profile array for bids Array representing percentage bid order liquidity at each price level from best to worst price, e.g., [10, 10, 30, 50]
La
Liquidity profile array for asks Array representing percentage ask order liquidity at each price level from best to worst price
Ps
Spot price Current price derived from market trades
Po
External price source (oracle) Price obtained from an external oracle
Ts
Spot price threshold Threshold level set for spot price
To
External price threshold Threshold level set for the external oracle price
Ti
Inventory imbalance threshold Threshold level of imbalance at which point additional spread is added

Configuration for BTC<>USDC Pool Osmosis

  • Spread:
    • Sa
      : 5%
    • Sb
      : 5%
  • Order Numbers
    • Na
      : 5
    • Nb
      : 5
  • Liquidity Profile:
    • La
      : [5, 10, 30, 30, 25]
    • Lb
      : [5, 10, 30, 30, 25]
  • Thresholds:
    • Ts
      : 0.7% - moves positions if the deviate more than this threshold from spot price
    • To
      : 0.7% - moves positions if the deviate more than this threshold from external price
    • Ti
      : 0.8 (would start adding spread if the inventory becomes imbalanced by a factor of 0.8)