🔱AMM

How the Marginal AMM Works

LPs passively pool both X and Y tokens in liquidity pools to make the perpetual market for the pair. Traders leverage this liquidity by borrowing from the pooled reserves, facilitating derivative positions. Subsequently, they seamlessly exchange one side of the borrowed liquidity for additional tokens on the other side of the borrowed liquidity, thus increasing their exposure to the desired asset while also maintaining a secure overcollateralization level.

At settlement, each trader delivers the debt needed to return the owed liquidity back to the pool and then receive the originally longed token in return.

In the event that the value of the margin token falls below the maintenance threshold, positions can be permissionlessly liquidated. This process involves returning the entirety of the collateral, minus applicable fees, back to the liquidity pool.

Math Plots: the sliders allow you to play with it to see robustness in all cases (deterministic safety).

Last updated