Stable Pool
Stable Pool Formula
Stable pools use a hybrid invariant formula to optimize swaps between assets with similar values (e.g., USDC/USDT, ETH/stETH):

Where:
x = reserve of
token_1
y = reserve of
token_2
k = invariant (constant), which must remain unchanged after each swap
Explanation:
The pricing curve of stable pools is flatter compared to the volatile pool formula (x * y = k).
This design minimizes slippage when swapping between tokens with nearly equal value.
The formula combines both sum and product effects, keeping prices stable within the equilibrium zone.
How to create stable pool
Use the create_pool
function from the router
module.
public entry fun create_pool(
token_1: Object<Metadata>,
token_2: Object<Metadata>,
is_stable: bool,
) {
...
}
Function Parameters
token_1
: The first token object used to create or provide liquidity.token_2
: The second token object used to create or provide liquidity.is_stable
: Set totrue
to create a stable pool.
Last updated