DEXToken
Search…
Exchange
This contract implements the trade routing proxy logic and on-chain token swap functionality.

Functions

swapMaxAmountOut

1
function swapMaxAmountOut(
2
address poolIn,
3
address poolOut,
4
uint maxAmountOut,
5
uint deadline
6
)
Copied!
Swap tokens for tokens. This function calculates a max of poolOut for an input amount of tokens for poolIn. This API executes a swap across two pools and can avoid decimals precise losses of the input amount.

swapExactAmountIn

1
function swapExactAmountIn(
2
address poolIn,
3
address poolOut,
4
uint exactAmountIn,
5
uint deadline
6
)
Copied!
Swap tokens for tokens. This function calculates a max of poolOut for an input amount of exactAmountIn of poolIn. This legacy swap function is UI-friendly but would cause decimals precise losses.
Last modified 6mo ago
Copy link