V3Estimator
해당 컨트랙트는 v3 스왑 금액을 추정합니다.
Code
Github Link: (Will be updated after official launch)
Address
Events, Read-Only Functions, and State-Changing Functions
Read-Only Functions
estimatePos
function estimatePos(
struct IUniswapV3Pool pool,
address token,
uint256 amountIn
) external view returns (
uint256 amountOut,
uint160 sqrtPriceX96After
)
Parameters:
Name
Type
Description
pool
contract IUniswapV3Pool
풀 주소
token
address
교환되는 토큰
amountIn
uint256
원하는 투입량
Return Values:
Name
Type
Description
amountOut
uint256
받을 토큰의 양
sqrtPriceX96After
uint160
스왑 후 sqrt 가격
estimateNeg
function estimateNeg(
contract IUniswapV3Pool pool,
address token,
uint256 amountOut
) external view returns (
uint256 amountIn,
uint160 sqrtPriceX96After
)
Parameters:
Name
Type
Description
pool
contract IUniswapV3Pool
풀 주소
token
address
교환되어 받을토큰
amountOut
uint256
원하는 출력량
Return Values:
Name
Type
Description
amountIn
uint256
amountOut
을 받기 위해 스왑에 대한 입력으로 필요한 금액
sqrtPriceX96After
uint160
스왑 후 sqrt 가격
estimate
function estimate(
contract IUniswapV3Pool pool,
bool zeroForOne,
int256 amountSpecified
) public view returns (int256 amount0, int256 amount1, uint160 sqrtPriceX96After) {
Parameters:
Name
Type
Description
pool
contract IUniswapV3Pool
풀 주소
zeroForOne
bool
스왑 방향이 0 -> 1인지?
amountSpecified
int256
지정된 양의 토큰
Return Values:
Name
Type
Description
amount0
int256
변경된 token0 수량
amount1
int256
변경된 token1 수량
sqrtPriceX96After
uint160
스왑 후 sqrt 가격
Last updated
Was this helpful?