# Sqrt Price Limit

In a **Concentrated Liquidity Market Maker (CLMM)**, the `sqrt_price_limit` parameter is used to define a price boundary for a swap — effectively acting as a **slippage protection mechanism**. Depending on the direction of your trade (i.e., which token you're selling vs. buying), you must use either a `min_sqrt_price_limit` or `max_sqrt_price_limit`.

**Determining Token Order**

Each CLMM pool defines a `token0` and a `token1`.\
You can identify the token order by using the `get_pool_view` function.

***

#### Swap Direction and Price Limits

| Trade Direction   | Use Limit              | Description                                                                          |
| ----------------- | ---------------------- | ------------------------------------------------------------------------------------ |
| `token0 → token1` | `min_sqrt_price_limit` | Sets a lower bound on the price to prevent excessive slippage when selling `token0`  |
| `token1 → token0` | `max_sqrt_price_limit` | Sets an upper bound on the price to prevent excessive slippage when selling `token1` |

**Example:**

If the pool consists of:

* `token0` = USDC
* `token1` = MOVE

Then:

* **Swapping USDC → MOVE**: Use `MIN_SQRT_PRICE`
* **Swapping MOVE → USDC**: Use `MAX_SQRT_PRICE`

***

#### Constants

```ts
export const MIN_SQRT_PRICE = "281480266797392";
export const MAX_SQRT_PRICE = "5192199275492655220258463701383891";
```

Use these constants to safely bound the swap and avoid undesired price execution due to rapid pool movement or low liquidity conditions.


---

# 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.yuzu.finance/technical/smart-contracts/yuzu-clmm/sqrt-price-limit.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.
