Stable Math
Overview
Stable Math is designed to allow for swaps between any assets that have the same price, or are "pegged" to the same asset. The most common examples are stablecoins that track US Dollars (DAI, USDT, USDC), and assets that track the price of Bitcoin (WBTC, renBTC, sBTC). Prices are determined by the pool balances, the amplification parameter, and amounts of the tokens that are being swapped.
Invariant
Since the Stable Math equation is quite complex, determining the invariant, , is typically done iteratively.
Where:
is the number of tokens
is balance of token
is the amplification parameter
Last updated