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), and one of two compliance models:
Whitelisted pool. A
WhitelistTransferHookon 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
Deploy the
MetalexIssuerFeeHook(src/hooks/uniswap/) and callinitialize(auth, poolManager). The hook declaresbeforeSwap/afterSwappermissions (with return deltas), and Uniswap v4 requires the hook address to encode those flags, so deploy it at a mined address with the standardHookMinersalt-mining flow.Initialize a Uniswap v4 pool pairing the
CyberScripagainst a stablecoin, withhooksset to the deployed fee hook.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 most10_000.Seed liquidity. If the scrip has a
WhitelistTransferHook, whitelist every address the scrip passes through: in Uniswap v4 that is the singletonPoolManager, 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 fromscripifyCertmust be whitelisted as well.
See also Hooks, CyberScrip and Composability.
Last updated
Was this helpful?
