Uniswap / v3-sdk

🛠 An SDK for building applications on top of Uniswap V3
MIT License
544 stars 416 forks source link

What is the significance of "POOL_INIT_CODE_HASH" ? #141

Open debo24 opened 1 year ago

debo24 commented 1 year ago

In the file "v3-sdk/src/constants.ts" and line number 5, what is the importance of "POOL_INIT_CODE_HASH"?

Florian-S-A-W commented 1 year ago

Hi @debo24

Uniswap uses CREATE2 to determine the address of a pool. The advantage is that the address of a pool with two specific tokens and a specific fee tier is deterministic and computable wether the pool is deployed or not. The SDK uses it in computePoolAddress.