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:
pool
contract IUniswapV3Pool
The address of the pool
token
address
The token being swapped in
amountIn
uint256
The desired input amount
Return Values:
amountOut
uint256
The amount of the token that would be received
sqrtPriceX96After
uint160
The sqrt price after the swap
estimateNeg
Parameters:
pool
contract IUniswapV3Pool
The address of the pool
token
address
The token being swapped out
amountOut
uint256
The desired output amount
Return Values:
amountIn
uint256
The amount required as the input for the swap in order to receive amountOut
sqrtPriceX96After
uint160
The sqrt price after the swap
estimate
Parameters:
pool
contract IUniswapV3Pool
The address of the pool
zeroForOne
bool
Is swap direction 0 -> 1?
amountSpecified
int256
The specified amount of token
Return Values:
amount0
int256
The changed amount of token0
amount1
int256
The changed amount of token1
sqrtPriceX96After
uint160
The sqrt price after the swap
Last updated