Muffin

From DefiLlama
Revision as of 10:55, 19 September 2022 by Define (talk | contribs) (Muffin)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

AMM with concentrated liquidity + multiple fee tiers per pool + keeper-less limit orders.

Core features

Concentrated liquidity

The earlier version of AMM forces LPs to allocate capital on the price range of (0, ∞). This is wasteful because a large part of the liquidity will never be put into service, as token price will very unlikely jump to extremely high or fall to zero during your time of providing liquidity.

Concentrated liquidity was introduced in UNI V3, and Muffin inherits the same design. LPs can concentrate their capital into their selected price range and therefore provide a greater level of liquidity, without the need to allocate capital outside the selected price ranges. In other words, it makes LP's capital more efficient.

Multiple fee tiers per pool

Under the hood, each fee tier of a pool acts like an "inner pool", and has its independent price and liquidity. LPs allocate liquidity by selecting a fee tier and a price range — similar UX to UNI v3. The most significant difference is LPs are now given more fee tiers to choose from.

Limit range orders

Let's say a limit-range-order position is going to be fully converted to its target token at $1. And, in AMM, every swap is a price impact. So, when a swap moves the price to reach $1, the protocol will "settle" the limit-range-order position within the swap, as if the LP withdraws the liquidity in the same transaction alongside the swap. After that, the positions' liquidity will not be put into service again even if the price moves backward.

Internal accounts

Internal accounts are for Muffin's users to store any ERC-20 tokens inside Muffin's contract, instead of storing them in their own wallets. You can use the internal account to pay and/or receive tokens during a swap or when providing/withdrawing liquidity.

Sources: