After researching the Drift Protocol, I fully understand why Solana is obsessed with CLOB, which is the order book.
Implementing perpetual contract AMM on-chain is incredibly difficult. This has led to a shift towards embracing centralized market makers.
Although the vAMM (virtual AMM) created by Perpetual Protocol addresses the issue of leveraging based on the spot AMM X * Y = K.
Without centralized market makers, perpetual contract AMMs must solve issues such as counterparty risk (for example, all users going long with no one shorting), depth, and price divergence (the perpetual contract price diverging from the spot price) through predetermined numerical rules.
This makes the parameters and their formulaic expressions in Drift v1 exceptionally complex.
It is so complex that, based on the state of contract price divergence, market conditions must be defined, such as Healthiest Market, Unhealthy Market, etc., totaling four scenarios, to assess the long-short imbalance state, determine whether to liquidate user positions under that state, and provide solutions for adjusting coefficients.
At this point, it might feel overwhelming. Comparing it to an order book, one might feel that centralized solutions seem quite appealing. Now, can you understand Solana's obsession with order books a bit more?
Later, Drift launched a limit order feature, but the experience still differs somewhat from an order book.
Currently, trading on Drift is supported by three liquidity mechanisms:
1) JIT auctions, where market makers provide liquidity;
2) Limit order book, where market makers provide liquidity;
3) AMM, where if no market maker intervenes to provide liquidity, Drift's AMM will provide it.
However, after 00:00 UTC on August 7, Drift will abandon the AMM model and fully embrace centralized market makers.
vAMM faces the following core issues:
1) Continuous loss of funding rates. The protocol's insurance fund is essentially shorting volatility—during periods of high market volatility, it will be gradually eroded by arbitrageurs;
2) Inability to maintain price anchoring, requiring continuous subsidies to keep futures prices consistent with spot prices;
3) Path dependency issues. The further the price diverges, the higher the maintenance costs.
Even the progenitor of vAMM, Perpetual Protocol, is considering new directions, stating, "Perp V2 will adopt a more proactive market-making strategy to avoid the funding rate loss issues in V1. The new version will integrate features from Uniswap V3, and the team believes that the solution for decentralized perpetual contracts lies in the organic combination of CLOB and AMM models."
This shift essentially transforms the vAMM, which relies on mathematical formula pricing, into a model where market makers actively quote prices. The risk is shifted from the protocol to the market.
From the current perspective, the AMM model may only be suitable for spot trading. On-chain contract trading still needs to maintain a balance between decentralization and centralization.
Next, let's talk about vAMM, which is also the most challenging part. It might be a good sleep aid.
vAMM (virtual AMM)
The vAMM of Perpetual Protocol uses the same X * Y = K constant product formula as Uniswap.
For spot AMMs like Uniswap, users trade directly based on LP, and the price ratio of LP assets reflects the spot price.
In contrast, vAMM has a two-layer structure, where LP serves as collateral, and real assets are stored in the smart contract vault. vAMM is essentially a price discovery mechanism after users leverage.
For example,
1/ Assume the current price of ETH is 4000 USDT, and the initial vAMM pool consists of 100 ETH and 400,000 USDT.
2/ Alice uses 100 USDT as margin to go long on ETH with 10x leverage,
1) Alice deposits 1000 USDT into the smart contract as margin.
2) Perpetual Protocol credits 10,000 USDT (100 USDT × 10x leverage) to vAMM, which calculates the amount of ETH Alice should receive based on the constant product formula X * Y = K.
Initial state X * Y = K 100 ETH * 400,000 USDT = 40,000,000
After Alice deposits 1000 USDT, it becomes 410,000 USDT. X = K / Y 40,000,000 / 410,000 = 97.5609 ETH
Alice actually receives about 2.44 ETH.
At this point, the state within vAMM updates to 97.5609 ETH and 410,000 USDT.
3/ Bob then uses 1000 USDT as margin to short ETH with 10x leverage,
1) Bob deposits 1000 USDT into the same contract. Perpetual Protocol credits -10,000 vDAI to vAMM, which calculates the size of Bob's short position based on the constant product formula X * Y = K.
Bob shorts 2.4391 ETH, and the state within vAMM returns to 100 ETH and 400,000 USDT.
The pricing mechanism also employs a funding rate mechanism, similar to the funding payments in CEX perpetual contracts.
The specific formula uses that of the FTX exchange:
There is a crucial point here that is extremely important for understanding the difference between vAMM and traditional CEX contracts.
In CEX, every long position has a corresponding short position, meaning there is a real counterparty, so the holding users pay funding rates. The exchange is merely a trading venue and does not bear any holding risks. In vAMM, the situation is entirely different.
It can be seen that vAMM prices using X * Y = K, and the assets are pledged as collateral within the contract. So essentially, it is trading based on price curves rather than real counterparties.
Therefore, once faced with long-short imbalances, the protocol needs to find ways to attract real counterparties, and the method of attraction is subsidies.
This makes the stability of the subsidy source and the health of the liquidity pool extremely important, as it relates to the project's survival.
Especially in one-sided markets or during periods of significant price volatility, the liquidity pool essentially shorts volatility. The characteristic of shorting volatility is that it usually results in small profits but large losses during volatility.
Drift innovated on the vAMM of Perpetual Protocol and launched dAMM (dynamic AMM), where the difference is that parameters can be configured to address issues such as underlying price divergence, asymmetric long-short counterparties, and depth. However, there are still some issues that cannot be resolved.
Drift AMM
Drift adopts a dynamic AMM, improving upon the innovative virtual AMM (vAMM) of Perpetual Protocol, but with the following configurable parameters:
Peg: Price multiplier. Controls the degree of deviation between contract prices and spot prices, almost through hard control, anchoring contract prices to spot prices.
K: Controls liquidity depth. The larger the K value, the better the depth and the less slippage. Conversely, the same applies. In cases where contract prices deviate significantly from spot prices, lowering the K value helps induce price fluctuations, bringing contract prices closer to spot prices.
Fee Pool: Revenue primarily used to adjust Peg and K.
In conjunction with the four scenarios of oracle price (contract price) and mark price (spot price) deviation, the following table exists:
1/ Peg (Anchoring Multiplier)
When the vAMM contract price deviates from the market spot price, it is used to quickly adjust the price, bringing the underlying price closer to the real market price.
Formula:
Price = ( Y / X ) * Peg
Price = (Base Asset / Quote Asset) * Peg Multiplier
Adjustment Plan
After each trade, check the deviation between the oracle and mark price. 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 Peg to re-anchor the price;
2) If the fee pool reserves are insufficient, compare the costs of two options:
The cost of rate subsidies to attract arbitrage versus the cost of directly re-anchoring.
In general, it will be considered to first lower the K value, reducing liquidity depth to make it easier to push the price.
After the adjustment, the losing party's position will be accurately marked to market, while the winning party's position will be supplemented by the fee pool.
2/ k (Liquidity Depth)
Controls the size of slippage. This is quite understandable because it is X * Y = K; a larger K value means more of both assets X and Y, naturally resulting in less slippage.
Of course, since Drift is based on the vAMM of Perpetual Protocol, where X * Y = K serves the pricing function after leveraging, rather than representing real LP assets, the K value can be adjusted.
To summarize,
The k value controls the sensitivity of price to trading volume;
Peg adjusts the absolute level of the price.
3/ Fee Pool
Not only is it a source of income, but it is also a market adjustment tool. Its uses include: adjusting Peg and K values, and compensating profitable traders after adjustments, as well as paying for funding rate imbalances.
The main sources of income for the fee pool are:
1) Taker fees, with a base rate of 0.05-0.1%;
2) Liquidation fees, with 50% going to the fee pool;
3) Funding rate income.
At this point, it can be seen that this model heavily relies on the health of the fee pool. This will cause Drift to lose its advantage in terms of fees, which is one issue.
Another more fundamental problem is that income growth is linear, with trading volume * fee = income, but expenses may become exponential as the market trends one-sided, with price deviation squared * position size * time = expenses.
Therefore, 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
Under the vAMM model, users trading perpetual contracts need to deposit margin for potential liquidation. The X * Y = K formula essentially becomes a curve used for pricing.
Thus, based on this formula, Drift changed the pricing method, adding the Peg anchoring multiplier while also making the K value adjustable to anchor contract prices to spot prices. During the adjustment process, any profits from user positions are supplemented by the fee pool.
Therefore, this makes the fee pool extremely important, but in the long run, during extreme market conditions, expenses will grow exponentially while income can only grow linearly, leading to net subsidies for imbalanced positions.
Simply controlling on-chain AMM through mathematical formulas does not seem feasible at this point; centralized market makers are still needed to balance counterparties, which is the essence of perpetual contracts.
免责声明:本文章仅代表作者个人观点,不代表本平台的立场和观点。本文章仅供信息分享,不构成对任何人的任何投资建议。用户与作者之间的任何争议,与本平台无关。如网页中刊载的文章或图片涉及侵权,请提供相关的权利证明和身份证明发送邮件到support@aicoin.com,本平台相关工作人员将会进行核查。