Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

Free functions

constant_product_outCalculates output amount for a constant product swap. Given reserves x, y and input dx, returns dy such that (x+dx)(y-dy) = xy. Formula: dy = y × dx / (x + dx)
constant_product_in—
price_from_reserves—
slippage—
liquidity_share—
calculate_k—
initial_lp_tokens—
remove_liquidity—