Functions
Paramaters
RouteParam
@notice RouteParam is a struct that contains the parameters needed to execute a swap
| name | type | description |
|---|---|---|
| token_in | address | contract address of token to sell |
| token_out | address | contract address of token to buy |
| amount_in | uint256 | amount of token to sell |
| min_received | uint256 | minimum received amount of user get |
| destination | address | The receiver address for the output token |
| swap_type | enum(SwapType) | Swap type |
@notice SwapType is an enum that represents the type of swap
| name | value | description |
|---|---|---|
| ethToToken | 0 | eth to token |
| tokenToEth | 1 | token to eth |
| tokenToToken | 2 | token to token |
SwapParams
@notice SwapParams is a struct that contains the parameters needed to execute a swap
| name | type | description |
|---|---|---|
| token_in | ContractAddress | contract address of token to sell |
| token_out | ContractAddress | contract address of token to buy |
| rate | uint32 | rate * 10**4 gives 4 precision points |
| protocol_id | uint256 | procotol id |
| pool_address | address | pool contract address |
| swap_type | enum(SwapType) | Swap type |
| extra_data | Array(uint256) | extra data from route |
Events
Swap
| name | type | description |
|---|---|---|
| sender | address | address that execute the swap |
| token_in | address | contract address of token to sold |
| token_out | address | contract address of token to bought |
| amount_in | uint256 | amount of token to sold |
| amount_out | uint256 | amount of token to bought |
| destination | address | The receiver address for the output token |