Skip to content

Latest commit

 

History

History
269 lines (228 loc) · 18.6 KB

README.md

File metadata and controls

269 lines (228 loc) · 18.6 KB

Awesome AMM

List of AMM and Orderbook Resources

An overview of the prominent designs and large implementations

Automated Market Makers

History

A collection of the earliest posts regarding what came to be the automated market maker and it's many variations

A collection of popular iterations of various designs (listed below)

Designs

  • Constant Product

    Formula: (R_a - delta_a)(R_b + fees * delta_b) = k
    Simplified Formula: x * y = k

    Where R_α and R_β are reserves of each asset and γ is the transaction fee. Trading any amount of either asset must change the reserves in such a way that, when the fee is zero, the product R_αR_β remains equal to the constant k. This is often simplified in the form of xy=k, where x and y are the reserves of each asset. In practice, because Uniswap charges a 0.3% trading fee that is added to reserves, each trade actually increases k.

    Constant

  • Stableswap (Hybrid)

    Where x is the reserves for each asset, n is the number of assets, D is an invariant that represents the value in the reserve, and A is the “amplification coefficient”, which is a tunable constant that provides an effect similar to leverage and influences the range of asset prices that will be profitable for liquidity providers (i.e. the higher the asset volatility, the higher A should be).

    Function: An^n SUM(x_i) + D = ADn^n + D^(n+1) / n^n ∏ x_i

    This function acts as a constant sum when the portfolio is balanced and shifts towards a constant product as the portfolio becomes more imbalanced. In effect, the function looks like a “zoomed-in hyperbola”.

    Stableswap

  • Constant Mean

    A constant mean market maker is a generalization of a constant product market maker, allowing for more than two assets and weights outside of 50/50. First introduced by Balancer, constant mean markets satisfy the following equation in the absence of fees:

    Formula: k = ∏_n R^W_i

    where R is the reserves of each asset, W is the weights of each asset, and k is the constant. In other words, in the absence of fees, constant mean markets ensure that the weighted geometric mean of the reserves remains constant.

    Constant Mean

  • Concentrated Liquidity

    The defining idea of Uniswap v3 is concentrated liquidity: liquidity that is allocated within a custom price range. In earlier versions, liquidity was distributed uniformly along the price curve between 0 and infinity.

    The previously uniform distribution allowed trading across the entire price interval (0, ∞) without any loss of liquidity. However, in many pools, the majority of the liquidity was never used.

    Concentrated Liquidity relies on the concept of virtual liquidity which can be read and derived in their whitepaper

    Concentrated Liquidity

    Concentrated Liquidity Distribution

Source Constant Function Market Makers: DeFi’s “Zero to One” Innovation

Virtual Automated Market Makers

A virtual automated market maker (vAMM) uses formulas, such as constant product, but only as a price discovery mechanism.

Generally a vAMM product is designed with a "clearing house" or "controller" contract in which all of the collateral deposited is held.

vAMMs are primmarily used for perpetual future contracts in which the collateral in the clearing house backs virtual assets that users can trade.

Following the release of Perpetual Protocol's first vAMM there have been many iterations since, particularly with the price discovery mechanism.

Resources

Products

Derivatives

Options AMMs

There have been various implementations for an AMM that can be used for buying and selling of options.

Orderbooks

AMMs and Orderbooks

Other

Assorted Reading

Awesome Lists