> ## Documentation Index
> Fetch the complete documentation index at: https://shield.fi/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Price, ticks, and square-root price

> Interpret the current Q128.128 pool price and tick domain.

Each tick represents a base-unit price ratio of `1.0001^tick`. The contract stores the square root of that ratio in Q128.128 form:

```text theme={"languages":{"custom":["/languages/leo.tmLanguage.json"]}}
sqrt_price_x128(tick) = floor(sqrt(1.0001^tick) * 2^128)
```

The implementation uses a fixed integer cascade, not floating-point exponentiation.

## Domain

* User ticks: `-400000` through `400000`.
* Linked-list sentinels: `-400001` and `400001`.
* Minimum square-root ratio: `{ hi: 0, lo: 702075911466779181339691826087 }`.
* Maximum square-root ratio: `{ hi: 484680305, lo: 8756686347225649145659787327114459760 }`.

Pool creation requires its initial tick and square-root price to agree. Position ticks must align with pool spacing. Swap price limits must be on the correct side of the current price and inside the allowed ratio domain.

## Display conversion

The raw squared ratio compares native base units. To display token1 per token0, adjust for the two token decimals. Reverse the result when the interface displays the opposite token order.

Never derive a signed transaction limit with binary floating point. Use integer Q128.128 helpers and verify the limit against the current slot.
