Skip to main contentCrate cp_curve
Source - DepositResult
- Returned by
deposit_amounts: how much of each token was actually used,
and how many LP tokens to mint.
- CurveError
- Errors returnable by every function in this crate.
- deposit_amounts
- Compute how much of each input token to actually pull, and how many LP
tokens to mint, given proposed deposit amounts.
- integer_sqrt
- Integer square root, Newton’s method on u128.
- swap_output
- Given pool reserves and an input amount, compute how much of the other
token the swapper receives. No fee.
- swap_output_with_fee
- Same as
swap_output but takes a fee (in basis points) from the input
before the swap. The fee stays in the pool. - withdraw_amounts
- Compute how much of each underlying token to return to the LP for burning
lp_burn LP tokens.