Swap
exact input
For exact input swap, use the exact_input_swap_entry
function in the router_v3
module.
Function params
amount_out_min
: the threshold value of token output.
sqrt_price_limit
: a x64 fixed-point number, indicate price impact limit after swap
recipient
: output token receiver
exact output
For exact output swap, use the exact_output_swap_entry
function in the router_v3
module.
Function params
amount_in_max
: the threshold value of token input.
sqrt_price_limit
: a x64 fixed-point number, indicate price impact limit after swap
recipient
: output token receiver
Last updated