The MedusaSwap MMM: Revolutionary AMM for Liquidity Providers

MedusaSwap
6 min readApr 4, 2024

--

DEXes, AMMs, and Traditional Market Makers

Among the most noteworthy advancements in decentralized finance (DeFi) lies in the progression of decentralized exchanges (DEXes) alongside automated market makers (AMMs). These decentralized protocols have transformed passive savers into Liquidity Providers (LPs) for trading activities.

Conventional market makers (MMs) supply liquidity in centralized exchanges by presenting bids and offers and dynamically managing their sizes and prices using intricate mathematical models. This is a highly specialized endeavor typically reserved for sophisticated participants.

A more fitting term for market makers is ‘price makers’ since they establish ‘prices’ by showcasing bids and offers in the market. Traders who simply buy or sell at the bids and offers available in markets are labeled ‘price takers’ as they merely accept the prices provided by price makers. Price makers must allocate capital to provide liquidity and they earn a return on this capital through trading spreads when price takers transact against them. They purchase at bids and sell at offers, theoretically pocketing the difference.

AMMs enable passive savers to act as LPs. Passive LPs contribute the capital and receive a return from trading fees without the need to actively manage their positions. AMMs replace the sophisticated price-making process of traditional MMs with relatively simple mathematical frameworks based on the inventory of tokens in liquidity pools. This enables passive LPs to leave assets in these liquidity pools and reap returns from market-making activities previously exclusive to active market makers. This has established a new avenue for investors to deploy their assets and earn a yield, while also facilitating traders to benefit from abundant liquidity as more capital is allocated to liquidity provisioning activities.

Challenges of Current AMMs

The existing array of AMMs still remains overly simplistic compared to their traditional market-making counterparts. The most prevalent form of AMM is the constant product market maker (CPMM), which establishes ‘fair’ market prices by maintaining the product of token inventory balances constant. It relies on arbitrageurs to intervene and rectify price misalignments with the broader market, thereby leaving significant potential profits for passive LPs untapped. Sophisticated LPs providing liquidity to AMMs undertake substantial off-chain inventory management.

One major hurdle hindering AMMs from evolving closer to traditional MMs is the gas bottlenecks for executing sophisticated calculations on-chain. The entire market-making framework and intelligence need to operate on-chain to enable passive LPs to enjoy comparable returns to traditional MMs.

Another significant issue is the deployment of a constant fee model by AMMs. AMMs are exposed to volatility and fees should be linked to the level of volatility in the market. During periods of high market volatility, LP profits are eroded due to increased impermanent loss. Sophisticated LPs dynamically rebalance their token inventories, incurring additional expenses during volatile markets. Conversely, AMMs accumulate profits during stable market conditions when trading activity centers around a stable price. A constant fee fails to reflect these market dynamics, leading LPs to withdraw liquidity from AMMs during volatile periods, exacerbating market movements. Conversely, traders are less inclined to pay high fees on DEXes during stable times. This counteracts the desired dynamic. Volatility-sensitive pricing is necessary to incentivize LPs to maintain funds during volatile times and encourage traders to continue using DEXes during stable periods. LPs should earn higher fees during turbulent times and lower fees during calmer markets, fostering a fairer and more robust trading ecosystem.

The MMM Vision

Medusa Market Maker’s (MMM) vision is to develop an AMM that rivals the performance of traditional MMs. MedusaSwap operates on the lightning-fast Solana chain, eliminating the computational and gas cost bottlenecks faced by AMMs on EVM-based (Ethereum Virtual Machine) chains. MMM aims to be the first to leverage the full technical capabilities of Solana to deliver a high-performance AMM with significantly enhanced LP returns and a more dependable trading framework.

Under the current constant product market maker (CPMM) model, passive market makers are tied to a basic pricing mechanism. In its initial version, MMM introduces a more intelligent pricing mechanism to incentivize arbitrageurs while safeguarding the P&L of LPs and improving their impermanent loss profile. Enhancing LP performance would attract more liquidity, enabling traders to access greater liquidity, depth, more reliable trading during volatile periods, and reduced slippage. Subsequent versions will incorporate volatility-sensitive pricing and styled price bands.

MMM v1: Introduction of the Compensation Parameter ‘C’

The first step involves recognizing that CPMMs determine prices solely based on their own inventory balances. When a trader engages with a CPMM, the CPMM follows the constant product price curve. It begins bidding or offering aggressively to encourage arbitrageurs to intervene and quickly ‘hedge’ out its position. However, this setup may not be optimal. LPs could achieve better results by observing the broader market and making more informed pricing decisions.

The compensation parameter is introduced to establish the level of compensation LPs are willing to accept versus incentivizing arbitrageurs. MMM considers the oracle price and utilizes ‘C’ to determine the extent to which it should bid or offer when it has deviated from its starting balance. The price does not need to be as aggressive as under CPMM, yet arbitrageurs would still intervene as long as there is a trading profit to be made.

C regulates the extent to which an LP can compensate themselves versus arbitrageurs.

When C=0, the scenario mirrors CPMM. Arbitrageurs have the same incentive to rectify price discrepancies.

As C increases, the incentive for arbitrageurs decreases.

With C between 0 and 2, arbitrageurs receive less incentive than in CPMM. At C=2, arbitrageurs have no incentive.

By controlling arbitrageur compensation, LP impermanent loss is reduced, and the P&L profile improves over the CPMM model. Thorough backtesting has been conducted to demonstrate this, with results to be shared in a subsequent Medium post.

Here is the MMM pricing formula (excluding fees):

MMM Parameters

MMM Pricing Formula

Marginal price

Integration of Oracle Price in MMM Operations

Oracles provide data feeds from various markets to determine the mid-market price.

MMM not only considers the marginal price internally but also begins with a CPMM price and then evaluates the oracle price to improve upon CPMM.

If the CPMM’s marginal price is significantly higher than the oracle price, MMM adjusts it closer to the oracle price to enhance LP performance.

When C=0, the oracle price has no influence.

Under the MMM model, the risk of oracle price manipulation is mitigated. An attacker cannot manipulate the oracle price to induce MMM into displaying an incorrect or artificially low price. The CPMM serves as a safety net; if the oracle price is incorrect, the price reverts to the CPMM price.

Volatility-Adjusted Pricing — Ongoing Development

MMM will introduce a fee structure based on market volatility levels to appropriately compensate LPs according to market risk. Current AMMs fail to achieve this, resulting in reduced liquidity during volatile periods as sophisticated LPs withdraw liquidity. LPs in AMMs are essentially short volatility, and a fixed fee does not adequately address this risk-reward trade-off for LPs. Conversely, LPs are overcompensated during stable market conditions, and traders end up paying high costs during stable periods. By dynamically adjusting fees based on market volatility, MMM aims to accurately reflect this market dynamic,encouraging LPs to maintain liquidity even during volatile markets and facilitating a more dependable trading experience for users.

With MedusaSwap’s MMM core and integrated trading modules, passive LPs will no longer find themselves at a disadvantage, overshadowed by larger players. For the first time in DeFi, passive LPs can anticipate comparable returns to those of sophisticated market makers.

About MedusaSwap

MedusaSwap is a Solana-based DEX empowered by an on-chain intelligent and high-performance AMM designed to maximize returns for Liquidity Providers. Our vision is to establish an AMM that matches the pricing sophistication and returns of specialized market makers.

Join our fast-growing and supportive communities.

Telegram Chat | Telegram Announcement | Twitter | Website

--

--

MedusaSwap

Trade, earn, and grow with MedusaSwap’s intelligent cross-chain DEX featuring concentrated liquidity on #Solana blockchain.