SimulateSwap
Uniswap Getter Plugin - SimulateSwap
Description
A getter function that simulates swap on Uniswap V2 and returns values of the swap. (This swap doesn't change the state of the blockchain)
Method
simulateSwap(uint256,bytes32,address[])
Input Parameters
Name | Plugin Type | Description |
---|---|---|
to |
| Uniswap V2 Router address |
Method Parameters
Name | Plugin Type | Description |
---|---|---|
amount |
| Amount that will be swapped |
method |
| Method of the swap |
path |
| Path of the swap |
Returned Values
Name | Plugin Type | Description |
---|---|---|
amountIn |
| Amount that was used to swap with |
amountOut |
| Amount that was received after swap |
tokenIn |
| Token that was swapped from |
tokenOut |
| Token that was received |
Example
Example with initParams
Example without initParams
Learn more
Learn more about Uniswap function here
Last updated