From Drift's dilemma, see why Solana is persistent with the order book.

After researching the Drift Protocol, I fully understand why Solana is obsessed with CLOB, which is the order book.

Because it's really, really, really hard to implement perpetual contracts AMM on-chain. As a result, I gave up and turned to embrace centralized market makers.

Although the vAMM (virtual AMM) established by Perpetual Protocol solves the problem of leveraging based on the spot AMM X * Y = K.

However, without centralized market makers, perpetual contract AMMs must solve problems such as counterparty risk (for example, all users going long with no one going short), depth, and price deviation (the deviation of perpetual contract prices from spot prices) through pre-determined numerical rules.

This makes Drift v1 exceptionally complex in terms of adjustable parameters and their formal expressions.

It is so complex that it is necessary to define market conditions based on the deviation status of the contract price, such as Healthiest Market, Unhealthy Market, and so on, making a total of four situations. It is necessary to assess the long-short imbalance status and determine whether to liquidate user positions under that status, as well as the solution for adjusting coefficients.

Are you feeling overwhelmed seeing this? Comparing it to the order book, doesn't it seem like centralized things also look quite appealing? Now, can you understand a bit of Solana's obsession with the order book?

Later, Drift launched the limit order feature, but the experience is still somewhat different from the order book.

Currently, the trading on Drift is supported by three liquidity mechanisms:

  1. JIT auction, market makers provide liquidity;

  2. Limit order book, market makers provide liquidity;

  3. AMM, if there is no MM involved to provide liquidity, will be provided by Drift's AMM.

However, after 0:00 UTC on August 7th, Drift will abandon the AMM model and fully embrace centralized market makers.

vAMM will face the following core issues,

  1. The funding rate continues to erode. The protocol's insurance fund is equivalent to shorting volatility – it will be slowly eaten away by arbitrageurs during periods of high market volatility;

  2. Unable to maintain price anchoring, requiring continuous subsidies to ensure consistency between futures prices and spot prices.

  3. Path dependence issue. The further the price deviates, the higher the maintenance cost.

As the ancestor of vAMM, Perpetual Protocol is also considering new directions. "Perp V2 will adopt a more proactive market-making strategy to avoid the capital fee loss issues found in the V1 model. The new version will integrate the features of Uniswap V3, and the team believes that the solution for decentralized perpetual contracts lies in the organic combination of CLOB and AMM models."

This transformation actually changes the vAMM, which originally relied on mathematical formulas for pricing, to a market maker who actively quotes prices. The risk is transferred from the protocol to the market.

From the current perspective, the AMM model may only be applicable to spot trading. As for on-chain contract trading, it is still necessary to maintain a balance between decentralization and centralization.

Next, let's talk about vAMM, which is also the most difficult part. It could be a good helper for sleep.

vAMM (virtual AMM)

The vAMM of Perpetual Protocol uses the same constant product formula X * Y = K as Uniswap.

For spot AMMs like Uniswap, users trade directly based on LP, and the price ratio of LP assets reflects the spot price.

The vAMM is actually a two-layer structure, where the LP serves as collateral, and the real assets are stored in the smart contract vault. The vAMM is essentially a price discovery mechanism that comes into play after the user leverages.

For example,

1/ Assuming the current price of ETH is 4000 USDT, the vAMM pool initially contains 100 ETH and 400,000 USDT.

2/ Alice uses 100 U as margin to go long on ETH with 10x leverage,

  1. Alice deposits 1000 U into the smart contract as collateral.

  2. Perpetual Protocol will credit 10,000 U (100 U × 10x leverage) to vAMM, and vAMM will calculate the ETH that Alice should receive based on the constant product formula X * Y = K.

Initial state X * Y = K 100 ETH * 400,000 U= 40,000,000

After Alice deposited 1000U, it became 410,000 U. X = K / Y 40,000,000 / 410,000 = 97.5609 ETH

Alice actually received about 2.44 ETH.

At this time, the state within the vAMM is updated to 97.5609 ETH and 410,000 U.

3/ Bob subsequently used 1000 U as margin to short ETH with 10x leverage,

  1. Bob deposits 1000 U into the same contract. Perpetual Protocol credits -10,000 vDAI to vAMM, and vAMM calculates Bob's short position size based on the constant product formula X * Y = K.

Bob shorted 2.4391 ETH, at which point the state within the vAMM reverted to 100 ETH and 400,000 U.

The pricing mechanism also adopts a funding rate mechanism, similar to the funding rate payments of CEX perpetual contracts (funding payments).

The specific formula uses the FTX exchange:

There is actually a point here that is very, very, very important for understanding the difference between vAMM and traditional CEX contracts.

In a CEX, every long position has a corresponding short position, which means there are real counterparties, so position holders will pay a funding fee. The exchange is merely a trading venue and does not bear any position risk. However, in a vAMM, the situation is completely different.

It can be seen that vAMM uses X * Y = K for pricing, and the assets are pledged as margin in the contract. So essentially, it is trading based on the price curve rather than a real counterparty.

So once faced with an imbalance of long and short positions, the protocol needs to find a way to attract real counterparties, and the method of attraction is through subsidies.

This makes the stability of subsidy sources and the capital pool very important, as it relates to the project's survival.

Especially in a one-sided market or during extreme price fluctuations, the liquidity pool is equivalent to shorting volatility. The characteristic of shorting volatility is that it tends to yield small profits during normal times but can result in significant losses during periods of high volatility.

Drift has innovated on the vAMM of Perpetual Protocol by launching dAMM (dynamic AMM), where the difference lies in configurable parameters to address issues such as deviations from the underlying price, asymmetric long and short counterparties, and depth. However, there are still some issues that cannot be resolved.

Drift AMM

Drift adopts a dynamic AMM, which is an improvement based on the innovative virtual AMM (vAMM) of the Perpetual Protocol, but with the following configurable parameters:

  • Peg: Price multiplier. It controls the degree of deviation between the contract price and the spot price, almost in a hard control manner, anchoring the contract price to the spot price.
  • K: Controls liquidity depth. The larger the K value, the better the depth and the less the slippage. Conversely, the same applies. In cases where the contract price is extremely deviated from the spot price, lowering the K value helps to induce price fluctuations, bringing the contract price closer to the spot price.
  • Fee Pool (: The revenue is mainly used to adjust Peg and K.

In the four scenarios of the deviation between the oracle price (contract price) and the mark price (spot price), the following table is provided,

![])https://img-cdn.gateio.im/webp-social/moments-359f121f6d1adc2210dac9fa860f6759.webp(

)# 1/ Peg (Anchor Multiplier)

When the vAMM contract price deviates from the market spot price, it is used for quick price adjustments to bring the underlying price closer to the true market price.

Formula:

Price = ### Y / X ( * Peg

Price = (Base Asset / Quoted Asset) * Peg Multiplier

Adjustment Plan

Check the oracle - marked price deviation after each transaction. If the deviation exceeds the LIQ_LIMIT value (currently 10%), there will be two options,

  1. If the fee pool reserves are sufficient, directly adjust the Peg to re-anchor the price;

  2. If the reserve of the fee pool is insufficient, it will compare two types of costs:

Rate subsidies, the cost of attracting arbitrage, and the cost of direct re-pegging.

In general, it is considered to first lower the K value, reduce liquidity depth, making it easier to push the price.

After the adjustment, the positions of the losing party will be realistically marked to market, while the positions of the winning party will be supplemented by the fee pool.

)# 2/ k (liquidity depth)

Control the size of the slippage. It's actually quite easy to understand, because it is X * Y = K. A larger K value means that there are more of the two assets X and Y, naturally the larger the K value, the smaller the slippage.

Of course, because Drift is based on the vAMM of Perpetual Protocol, where X * Y = K acts as the pricing mechanism after leverage, and is not real LP assets, so the K value can be adjusted.

In summary,

The k value controls the sensitivity of price to trading volume;

The absolute level of the peg adjustment price

3/ Fee Pool

Not only is it income, but also a market adjustment tool. Usage: After adjusting the Peg value and k value, it is necessary to supply profits to profitable traders and pay for the imbalance in funding rates.

The main source of income for the fee pool,

  1. Taker transaction fee, base rate 0.05-0.1%;

  2. Liquidation fee, 50% goes to the fee pool;

  3. Funding rate income.

From here, it can actually be seen that this model is quite dependent on the health of the fee pool. This will cause Drift to lose its advantage in terms of transaction fees, which is one aspect.

Another fundamental issue is that income growth is linear, where trading volume * transaction fee = income, but expenses can become exponential as the market moves in one direction, where the square of price deviation * position size * time = expenses.

So from a longer-term perspective, expenses cannot fully cover income.

This is also why Drift wants to abandon vAMM and embrace centralized market making.

summary

In vAMM mode, users must deposit margin for trading perpetual contracts, which is used for potential liquidation. The formula X * Y = K is actually transformed into a pricing curve.

As a result, based on this formula, Drift changed the pricing method by adding a Peg anchoring multiplier, while also making the K value adjustable, in order to anchor the contract price to the spot price. During the adjustment process, any user position profits that occur will be supplemented by the fee pool.

Therefore, this makes the fee pool extremely important, but in the long term, in extreme market conditions, expenditures will grow exponentially while revenues can only grow linearly. This leads to a net subsidy for the imbalanced positions of the protocol.

Simply controlling on-chain AMM through mathematical formulas does not seem feasible. It still requires centralized market maker matching to balance the counterparties, which is the essence of perpetual contracts.

DRIFT8.72%
SOL3.65%
View Original
This page may contain third-party content, which is provided for information purposes only (not representations/warranties) and should not be considered as an endorsement of its views by Gate, nor as financial or professional advice. See Disclaimer for details.
  • Reward
  • Comment
  • Share
Comment
0/400
No comments
Trade Crypto Anywhere Anytime
qrCode
Scan to download Gate app
Community
English
  • 简体中文
  • English
  • Tiếng Việt
  • 繁體中文
  • Español
  • Русский
  • Français (Afrique)
  • Português (Portugal)
  • Bahasa Indonesia
  • 日本語
  • بالعربية
  • Українська
  • Português (Brasil)