V3Estimator
This contract estimates v3 swap amounts
Code
Github Link: (Will be updated after official launch)
Address
Events, Read-Only Functions, and State-Changing Functions
Read-Only Functions
estimatePos
Parameters:
Name | Type | Description |
---|---|---|
|
| The address of the pool |
| address | The token being swapped in |
| uint256 | The desired input amount |
Return Values:
Name | Type | Description |
---|---|---|
| uint256 | The amount of the token that would be received |
| uint160 | The sqrt price after the swap |
estimateNeg
Parameters:
Name | Type | Description |
---|---|---|
|
| The address of the pool |
| address | The token being swapped out |
| uint256 | The desired output amount |
Return Values:
Name | Type | Description |
---|---|---|
| uint256 | The amount required as the input for the swap in order to receive |
| uint160 | The sqrt price after the swap |
estimate
Parameters:
Name | Type | Description |
---|---|---|
|
| The address of the pool |
| bool | Is swap direction 0 -> 1? |
| int256 | The specified amount of token |
Return Values:
Name | Type | Description |
---|---|---|
| int256 | The changed amount of token0 |
| int256 | The changed amount of token1 |
| uint160 | The sqrt price after the swap |
Last updated