# Uniswap v2, v3 & v4

> How Crius indexes Uniswap v2 pairs, v3 concentrated-liquidity pools and v4 singleton pools with hooks on Robinhood Chain, including liquidity definitions and v4 hook permissions.

Source: https://crius.sh/docs/concepts/uniswap/

Crius indexes every Uniswap deployment on Robinhood Chain: v2 pairs, v3 pools at every fee tier, and v4 pools (including dynamic-fee and hooked pools).

## Identifying pools

| Version | Pool id in the API |
|---|---|
| v2 | Pair contract address (20 bytes) |
| v3 | Pool contract address (20 bytes) |
| v4 | Pool id (32 bytes): all v4 pools live inside one PoolManager contract |

## Liquidity

- For v2, reserves are the pair's balances.
- For v3 and v4, only **in-range** liquidity counts toward depth, computed from the pool's tick map.
- `liquidity_usd` is 2 × the quote side (ETH, WETH or USDG), the convention used by DEX screeners; `quote_liquidity_usd` is the quote side alone.

## v4 hooks

A Uniswap v4 pool can attach a **hook**: a contract called before or after swaps and liquidity changes. Hooks enable features like launch taxes and dynamic fees, but a hook can also block swaps, change amounts or stop liquidity removal.

The hook's **permissions** are encoded in the low 14 bits of its address, so they can be read without trusting the hook's code. Crius decodes them and turns them into risk flags:

| Permission | Risk flag |
|---|---|
| `beforeSwap` | `can_block_or_reprice_swaps` |
| `beforeSwapReturnDelta` / `afterSwapReturnDelta` | `can_modify_swap_amounts` |
| `beforeRemoveLiquidity` | `can_gate_liquidity_removal` |
| `beforeAddLiquidity` | `can_gate_liquidity_add` |
| `afterAddLiquidityReturnDelta` / `afterRemoveLiquidityReturnDelta` | `can_modify_liquidity_amounts` |
| unverified source | `unverified` |

See [`/hooks`](https://crius.sh/docs/reference/pools/#uniswap-v4-hooks) and [`/hook/{address}`](https://crius.sh/docs/reference/pools/#hook-detail). A token's security check includes its pool hook's permissions and any **hook tax** measured from real trades.
