MERLIN
  • ๐Ÿช„Overview
  • Starting on ZkSync
    • ๐Ÿ’œIntroducing ZkSync
      • ๐Ÿ“šGetting started on zkSync
    • ๐Ÿ”ฎStarting on Merlin
      • ๐Ÿ›ฃ๏ธPlatform Feature Guides
      • โœจBegin Lodging Liquidity
  • Protocol
    • โšกDynamic AMM
      • ๐ŸคCustom Fees & Referrals
    • ๐Ÿ’ซNon-Fungible-Magic
    • โš—๏ธCauldron Pools
    • ๐Ÿ‘จโ€๐ŸŒพCore Farming Pools
    • ๐Ÿง™โ€โ™‚๏ธMAGE Token
    • โšœ๏ธstMAGE Token
      • ๐Ÿ”“Staked Mage Vesting
  • Contract Base
    • ๐Ÿ›ก๏ธNative Smart Contracts
  • Community Roundtable
    • ๐Ÿ”Token distribution & Vesting
    • ๐ŸงฏTechniques of Deflation
    • โ”Key Protocol Links
Powered by GitBook
On this page
  • Merlin's Support of Volatile AMM Architecture
  • Merlin's Support of Stable AMM Architecture
  1. Protocol

Dynamic AMM

PreviousBegin Lodging LiquidityNextCustom Fees & Referrals

Last updated 2 years ago

The Merlin dAMM enables us to support a dual-state environment for liquidity operations on our platform. With this in mind, we have designed it to support a plethora of necessary functionality.

Our architecture is at its core, a peer-to-peer system designed for exchanging Tokens present on the .

At the forefront of this is our commitment to ensuring a censorship resistance, secure and self-custodial home for lodging liquidity.

You can learn more about our technical implementation of both & AMM infrastructure at Merlin below.

Merlin's Support of Volatile AMM Architecture

Merlin implements a novel support of the creation of pair contracts for any two ERC20 standard tokens on ZkSync with best path routing handled on-chain. In doing so we are able to support two core logic standards of pairing types

  • Volatile:

    xโˆ—y=kx * y = kxโˆ—y=k

Volatile pairs are composed of uncorrelated assets, based on 'Constant Product Formula'.

In summary, an AMM replaces the buy/sell orders present in traditional order book markets with a liquidity pool of two assets, both valued in a relative nature. As one asset is traded for the other, the relative prices of the two assets is adjusted, and a new market state is determined. In this dynamic, a buyer or seller trades directly with a given pool.

Pairs act as automated market makers, constantly ready to accept one token for the other as long as the โ€œconstant productโ€ formula is preserved. This formula is widely accepted as x * y = k, is defined by parameters (k) as constant of a pairโ€™s reserve balances (x and y). Because k remains unchanged from the reference frame of a trade, it is often referred to as the invariant.

Merlin's Support of Stable AMM Architecture

Merlin improves on the Volatile model by implementing pin-point liquidity, that is allocated within a dynamic and flexible price range. Effectively defined as a Stable Environment State

  • Stable:

x3y+y3x=kx^3y+y^3x=kx3y+y3x=k

As the price of an asset rises or falls, it may exit dynamically, determined by price bounds that LPs have set in a position. When out of this range, fees will not be accrued. Similarly, when price moves in one direction, LPs gain more of the one asset as swappers demand the other, until their entire liquidity consists of only one asset. Importantly, LPs are free to create as many positions as they see fit, each with its own price interval which is achieved by Tick boundaries of 0.01% intervals.

Volatile AMM Overview

With this, if a liquidity provider chooses this pair type, their capital is concentrated to smaller price intervals than (0, โˆž).

โšก
โ€‹
โ€‹
ZkSync ERA Mainnet
Volatile
Stable