# V3Estimator

해당 컨트랙트는 V3 스왑 금액을 추정합니다.

## Code

Github Link: (Will be updated after official launch)<br>

## Address

* Cypress : [0xBAf0Bc5cEDeaF8DbE639Ad7444cB4758Ea6710c3](https://klaytnscope.com/account/0xBAf0Bc5cEDeaF8DbE639Ad7444cB4758Ea6710c3?tabId=internalTx)

## Events, Read-Only Functions, and State-Changing Functions

{% tabs %}
{% tab title="Read-Only Functions" %}

## Read-Only Functions

**estimatePos**

```solidity
function estimatePos(
    struct IUniswapV3Pool pool, 
    address token, 
    uint256 amountIn
) external view returns (
    uint256 amountOut, 
    uint160 sqrtPriceX96After
)
```

**Parameters:**

<table><thead><tr><th width="134.66666666666666">Name</th><th width="178">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>pool</code></td><td><code>contract IUniswapV3Pool</code></td><td>풀 주소</td></tr><tr><td><code>token</code></td><td>address</td><td>교환되는 토큰</td></tr><tr><td><code>amountIn</code></td><td>uint256</td><td>원하는 투입량</td></tr></tbody></table>

[**​**](https://docs.uniswap.org/contracts/v3/reference/core/UniswapV3Pool#parameters)**Return Values:**

<table><thead><tr><th width="219.66666666666666">Name</th><th width="101">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>amountOut</code></td><td>uint256</td><td>받을 토큰의 양</td></tr><tr><td><code>sqrtPriceX96After</code></td><td>uint160</td><td>스왑 후 sqrt 가격</td></tr></tbody></table>

**estimateNeg**

```solidity
function estimateNeg(
    contract IUniswapV3Pool pool, 
    address token, 
    uint256 amountOut
) external view returns (
    uint256 amountIn, 
    uint160 sqrtPriceX96After
)
```

**Parameters:**

<table><thead><tr><th width="145.66666666666666">Name</th><th width="178">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>pool</code></td><td><code>contract IUniswapV3Pool</code></td><td>풀 주소</td></tr><tr><td><code>token</code></td><td>address</td><td>교환되어 받을토큰</td></tr><tr><td><code>amountOut</code></td><td>uint256</td><td>원하는 출력량</td></tr></tbody></table>

[**​**](https://docs.uniswap.org/contracts/v3/reference/core/UniswapV3Pool#parameters)**Return Values:**

<table><thead><tr><th width="219.66666666666666">Name</th><th width="101">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>amountIn</code></td><td>uint256</td><td><code>amountOut</code>을 받기 위해 스왑에 대한 입력으로 필요한 금액</td></tr><tr><td><code>sqrtPriceX96After</code></td><td>uint160</td><td>스왑 후 sqrt 가격</td></tr></tbody></table>

**estimate**

```solidity
function estimate(
    contract IUniswapV3Pool pool,
    bool zeroForOne,
    int256 amountSpecified
) public view returns (int256 amount0, int256 amount1, uint160 sqrtPriceX96After) {
```

**Parameters:**

<table><thead><tr><th width="202.66666666666666">Name</th><th width="178">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>pool</code></td><td><code>contract IUniswapV3Pool</code></td><td>풀 주소</td></tr><tr><td><code>zeroForOne</code></td><td>bool</td><td>스왑 방향이 0 -> 1인지?</td></tr><tr><td><code>amountSpecified</code></td><td>int256</td><td>지정된 양의 토큰</td></tr></tbody></table>

[**​**](https://docs.uniswap.org/contracts/v3/reference/core/UniswapV3Pool#parameters)**Return Values:**

<table><thead><tr><th width="219.66666666666666">Name</th><th width="101">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>amount0</code></td><td>int256</td><td>변경된 token0 수량</td></tr><tr><td><code>amount1</code></td><td>int256</td><td>변경된 token1 수량</td></tr><tr><td><code>sqrtPriceX96After</code></td><td>uint160</td><td>스왑 후 sqrt 가격</td></tr></tbody></table>

[**​**](https://docs.uniswap.org/contracts/v3/reference/core/UniswapV3Pool#parameters)
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs-new.klayswap.com/developers/contract/v3estimator.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
