โกDynamic AMM
Last updated
Last updated
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 ZkSync ERA Mainnet.
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 Volatile & Stable AMM infrastructure at Merlin below.
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 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 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:
With this, if a liquidity provider chooses this pair type, their capital is concentrated to smaller price intervals than (0, โ). โ
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.