> For the complete documentation index, see [llms.txt](https://docs.kumbaya.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kumbaya.xyz/developers/dex-integration/pool-init-code-hash.md).

# Pool Init Code Hash

Kumbaya's V3 fork deploys pools with a **different init code hash** from upstream Uniswap V3. If you compute pool addresses off-chain (the standard CREATE2 derivation), you must use Kumbaya's hash:

```
0x851d77a45b8b9a205fb9f44cb829cceba85282714d2603d601840640628a3da7
```

This is the hash of the `UniswapV3Pool` deployment bytecode in [Kumbaya's v3-core fork](https://github.com/Kumbaya-xyz/v3-core), and it applies to **both MegaETH mainnet (4326) and testnet (6343)**.

## Using it through the SDK

`@kumbaya_xyz/v3-sdk` exposes two things:

```ts
import { POOL_INIT_CODE_HASH, poolInitCodeHash } from '@kumbaya_xyz/v3-sdk'
```

| Export                                 | What it is                                                                                                            | When to use             |
| -------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | ----------------------- |
| `POOL_INIT_CODE_HASH` (constant)       | **Deprecated** - returns the upstream Uniswap hash `0xe34f199b…87b8b54`. Kept for backwards compatibility.            | Don't use for new code. |
| `poolInitCodeHash(chainId)` (function) | Returns the chain-specific hash. For `ChainId.MEGAETH` and `ChainId.MEGAETH_TESTNET`, returns the Kumbaya hash above. | This one.               |

> ⚠️ **Don't import the constant.** It's named `POOL_INIT_CODE_HASH` but returns Uniswap's hash, not Kumbaya's. The SDK's `Pool.getAddress` and `computePoolAddress` use the function internally - they handle this correctly without the constant.

## In practice you don't have to think about this

`Pool.getAddress(tokenA, tokenB, fee)` and `computePoolAddress({ chainId, tokenA, tokenB, fee })` both call `poolInitCodeHash(chainId)` internally and compute the right CREATE2 address. So if you're using the SDK normally, you won't see this hash at all.

You only need the raw value if you're:

* Deriving pool addresses without the SDK (e.g. in Solidity, Rust, or another language).
* Pre-computing addresses across many chains in one go.
* Verifying behavior in tests.

## Self-check

If pool address derivation gives you a contract that doesn't exist on-chain - or worse, exists but has the wrong tokens - you're almost certainly using Uniswap's hash by mistake. Sanity-check against the [`integrator-kit`](https://github.com/Kumbaya-xyz/integrator-kit), which derives pool addresses on MegaETH and asserts equality.

## Used everywhere downstream

This hash is what every Kumbaya periphery contract uses internally to verify pool callbacks - `SwapRouter02`, `NonfungiblePositionManager`, `QuoterV2`, `UniversalRouter`, etc. So it's not just an SDK detail; it's how the entire stack derives pool addresses on Kumbaya's V3 fork.
