> For the complete documentation index, see [llms.txt](https://docs.metalex.tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.metalex.tech/building-on-the-protocol/how-to/deploy-liquilex-pool.md).

# Deploy a LiquiLeX pool

Pair a company's scrip against a stablecoin in a Uniswap v4 pool with MetalexIssuerFeeHook, under a whitelisted or open compliance model

**LiquiLeX** provides AMM liquidity for a company's scrip in Uniswap v4 pools, with the **`MetalexIssuerFeeHook`** routing swap fees to MetaLeX and the issuer.

## Choose a compliance model

You need a cyberCORP with a deployed `CyberScrip` for the class you want to make liquid (see [Scripify and settle a secondary trade](/building-on-the-protocol/how-to/scripify-and-settle.md)), and one of two compliance models:

* **Whitelisted pool.** A `WhitelistTransferHook` on the scrip, with the pool's custody addresses whitelisted. Only whitelisted addresses can send or receive the scrip, so credential checks happen when an address is added to the whitelist.
* **Open pool.** No transfer hook. Compliance is enforced when scrip converts back into a Ledger Entry Token (LET), optionally with a zkPassport check at the swap.

## Deploy the hook and the pool

1. Deploy the `MetalexIssuerFeeHook` ([`src/hooks/uniswap/`](https://github.com/MetaLex-Tech/cybercorps-contracts/tree/develop/src/hooks/uniswap/README.md)) and call `initialize(auth, poolManager)`. The hook declares `beforeSwap`/`afterSwap` permissions (with return deltas), and Uniswap v4 requires the hook address to encode those flags, so deploy it at a mined address with the standard `HookMiner` salt-mining flow.
2. Initialize a Uniswap v4 pool pairing the `CyberScrip` against a stablecoin, with `hooks` set to the deployed fee hook.
3. As a BorgAuth admin, configure the pool's fees with `setPoolConfig(key, metalexRecipient, issuerRecipient, metalexFeeBps, issuerFeeBps, enabled)`. Both fees are in basis points, and together they can be at most `10_000`.
4. Seed liquidity. If the scrip has a `WhitelistTransferHook`, whitelist every address the scrip passes through: in Uniswap v4 that is the singleton `PoolManager`, which holds every v4 pool's balances, plus any router or position manager that takes custody of the scrip in your flow. Scrip hooks also run when scrip is minted, so every address that receives scrip from `scripifyCert` must be whitelisted as well.

See also [Hooks](/building-on-the-protocol/reference/hooks.md), [CyberScrip](/building-on-the-protocol/reference/contracts/cyberscrip.md) and [Composability](/how-cybercorps-works/composability.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.metalex.tech/building-on-the-protocol/how-to/deploy-liquilex-pool.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
