Deploy a LiquiLeX pool
LiquiLeX provides AMM-native secondary liquidity for cyberSCRIP using Uniswap v4 pools, with the MetalexIssuerFeeHook routing swap fees to MetaLeX and the issuer.
Prerequisites
A cyberCORP with a deployed
CyberScripfor the class you want to make liquid (see Tutorial 3).A chosen compliance model:
Whitelisted pool — a
WhitelistTransferHookon the cyberSCRIP, with the pool address whitelisted; full credential checks at the swap layer.Open pool — no transfer hook; compliance enforced at the de-scripification boundary, optionally with a zkPassport check at swap.
Approach
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 at a mined address (the standardHookMinersalt-mining flow).Initialise a Uniswap v4 pool pairing the
CyberScripagainst a stablecoin, withhooksset to the deployed fee hook.Configure fees for the pool (BorgAuth admin):
setPoolConfig(key, metalexRecipient, issuerRecipient, metalexFeeBps, issuerFeeBps, enabled)— both fees in basis points, combined at most10_000.Seed liquidity. If the cyberSCRIP has a
WhitelistTransferHook, whitelist the pool address.
Related
Explanation: Composability and DeFi.
Last updated
Was this helpful?
