11min

Drift's Dynamic AMM

On Drift, all trades are executed against a dynamic virtual AMM ("DAMM").

The DAMM:

  1. works to reduce slippage for traders over time;
  2. is adaptable to the demand for trading in the market; and
  3. reduces the oracle and terminal price divergence over time.

See Glossary for commonly used terms on DAMMs.

Virtual AMM

The DAMM is an improvement on the existing Virtual AMM (vAMM) pioneered by Perpetual Protocol. Here we briefly describe how the vAMM works. (This calculator can help: https://www.desmos.com/calculator/7wbvkts2jf)

The current implementation is a two-dimensional constant product curve using the x * y = k invariant.

Peg Multiplier

The market price for x in terms of y is the slope of the curve given the relative scarcity, and can be multiplied by an arbitrary constant C (essentially the magnitude of y):

price = (y/x) * C

The reason to add the peg multiplier is to ensure that prices are balanced in the center of the curve. We want to concentrate prices around the center of the curve as this is where slippage is the lowest.

In Drift's naming convention, this looks like:

mark_price = (quote_asset_reserve/base_asset_reserve) * peg_multiplier

Dynamic AMM

The Dynamic AMM provides low slippage that changes the parameters of the curve formulaically based on growing open interest (OI) of the platform as well as oracle price drifting away from the terminal price.

The Dynamic AMM has two key features: (1) curve-repeggingl; and (2) k-adaptability. Both mechanisms use protocol fees collected from trading to ensure that traders positively benefit from the changes in the DAMM.

1) Drift Cover (Repegging the Curve)

Repegging is akin to altering the quote asset's reserves.

What does Drift Cover solve?

Over time, prices tend to drift from the market's inception/terminal price. Without a mechanism in place, trading will end up occuring at the outer ends of the curve where liquidity is not focused and where slippage is higher.

How does Drift Cover work?

Drift Cover (a repegging mechanism) solves the long term price drift problem.

A repeg event reduces the oracle-mark spread and rewards market participants with additional liquidity at a more accurate mark price. Additionally, trading stays closer to the center of the curve where liquidity is focused.

Drift achieves this by programatically adjusting the peg multiplier towards the oracle price.

When do repegs occur and how big are they?

Initially, the admin will run repegs to benefit healthy market conditions. This includes ensuring a low average oracle-mark spread and a diverse open interest.

The catch for repegging is that the market doesn't want to deplete the fee's collected on price changes that may soon revert. Preliminary analyses indicate >10% mark-peg divergence and persistently large funding rates are a good inflection point to consider a repeg event.

Current repeg fee fraction: 50% (This fee fraction is controllable by the admin, which will eventually go under control of the DAO.) See Rebates

2) Adaptable K

Adjusting k is akin to scaling both the base and quote asset reserves in tandem.

Our goal is to monotonically increase k (reserve invariant) over time as the platform and OI grows. K is bound by the fees collected.

A high appetite for arbitraging volume per oracle price movement encourages us to support a higher k. In return, this provides lower slippage for Traders.

Mark-exit spread goes down when k goes up, because the slippage needed to close positions is reduced.

E.g.: doubling sqrt(k) => users will pay roughly half the slippage.

Current k fee fraction: 100% (This fee fraction is controllable by the admin, which will eventually go under control of the DAO.) See Rebates

Who Adjusts K

At this stage, the Drift core team manages the liquidity of the vAMM formulaically. Adding too much liquidity to the pool poses a problem for arbitrageurs as they won't have enough capital to keep the vAMM price in line with the underlying index price via funding payments.

Drift believes the game theory of trading DAMMs comes from backward induction on the terminal price. The goal of repegging / adjusting k is to keep the terminal price, mark price, and oracle price close to each other - regardless of the length of time the market has been initiatlised for.





Updated 31 Mar 2022
Did this page help?
Yes
No