Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

constant_product_out

Calculates 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)

Fully qualified path: cairo_fp::f64::math::pool::constant_product_out

fn constant_product_out(x: Fixed, y: Fixed, dx: Fixed) -> Option<Fixed>