Computes the exact input or output amount for a swap transaction.
token_out
specified_token_a
true
slippage_tolerance
whirlpool
tick_arrays
transfer_fee_a
transfer_fee_b
The exact input or output amount for the swap transaction.
Optional
Computes the exact input or output amount for a swap transaction.
Arguments
token_out
: The output token amount.specified_token_a
: Iftrue
, the output token is token A. Otherwise, it is token B.slippage_tolerance
: The slippage tolerance in basis points.whirlpool
: The whirlpool state.tick_arrays
: The tick arrays needed for the swap.transfer_fee_a
: The transfer fee for token A.transfer_fee_b
: The transfer fee for token B.Returns
The exact input or output amount for the swap transaction.