V1SwapRouter
Router for stateless execution of swaps against Dragonswap
Functions
_swap
swapExactTokensForTokens
Swaps amountIn
of one token for as much as possible of another token
Setting amountIn
to 0 will cause the contract to look up its own balance, and swap the entire amount, enabling contracts to send tokens before calling this function.
Parameters
Name | Type | Description |
---|---|---|
|
| The amount of token to swap |
|
| The minimum amount of output that must be received |
|
| The ordered list of tokens to swap through |
|
| The recipient address |
Returns
Name | Type | Description |
---|---|---|
|
| The amount of the received token |
swapTokensForExactTokens
Swaps as little as possible of one token for an exact amount of another token
Parameters
Name | Type | Description |
---|---|---|
|
| The amount of token to swap for |
|
| The maximum amount of input that the caller will pay |
|
| The ordered list of tokens to swap through |
|
| The recipient address |
Returns
Name | Type | Description |
---|---|---|
|
| The amount of token to pay |
Last updated