This section lists the addresses of Valantis' core protocol contracts and Module factories. It also provides examples on how to deploy working Pools with Modules.
Deployments
Ethereum (mainnet)
Protocol Factory: Sovereign Pool Factory: Validly Factories:
HOT AMM WETH/USDC:
HyperEVM
Protocol Factory:
Sovereign Pool Factory:
stHYPE AMM stHYPE/HYPE: stHYPE AMM Withdrawal Module:
Arbitrum
Protocol Factory:
Sovereign Pool Factory: Validly Factories:
HOT AMM WETH/USDC:
Ink
Protocol Factory:Sovereign Pool Factory:Validly Factories:
Base
Protocol Factory: Sovereign Pool Factory:
Mantle
Morph L2
Sovereign Pool: Build your own DEX
This example is for developers wanting to use Valantis' Sovereign Pool as base smart contract infrastructure in order to build a custom DEX on Ethereum mainnet.
// Valantis Protocol Factory on Ethereum mainnet
// IProtocolFactory can be imported from valantis-core:
// https://github.com/ValantisLabs/valantis-core/blob/main/src/protocol-factory/interfaces/IProtocolFactory.sol
// Similar process for other EVM chains, only requires changing factory addresses.
IProtocolFactory protocolFactory = IProtocolFactory(0x29939b3b2aD83882174a50DFD80a3B6329C4a603);
// Initialize struct containing pool's initialization parameters.
// Can be imported from valantis-core:
// https://github.com/ValantisLabs/valantis-core/blob/main/src/pools/structs/SovereignPoolStructs.sol#L8-L20
SovereignPoolConstructorArgs poolArgs;
// Address of pool's token0 and token1.
poolArgs.token0 = 0x...;
poolArgs.token1 = 0x...;
// Address of pool manager
// This is only required to whitelist the Liquidity Module address after deployment,
// It can be reset to zero address afterwards (yielding an immutable pool)
poolArgs.poolManager = 0x...;
// This is the address where pool reserves are stored
// (e.g. any external Vault or Singleton).
// In this example we want to use the pool as the location of token0 and token1 reserves,
// similar to traditional DEXes which have pools as token pairs,
// hence pass it as zero address.
poolArgs.sovereignVault = address(0);
// The pool is configured with a constant swap fee of 5 basis-points.
// Pool manager can change this at any time by adding a custom Swap Fee Module.
poolArgs.defaultSwapFeeBips = 5;
// Deploy Sovereign Pool
address pool = protocolFactory.deploySovereignPool(poolArgs);
// As a developer, the pricing logic of your custom DEX was built as a Liquidity Module.
// See Sovereign Pool docs for more details about its required interface.
address liquidityModule = 0x...;
// Initialize the pool with the custom Liquidity Module deployment
pool.setALM(liquidityModule);
// (Optional), set other modules in the pool, such as Oracle Module or Swap Fee Module
// This is helpful in case there are other domain specific modules whose logic
// can be reused and composed with the Liquidity Module without any changes.
/// ...
// Make pool immutable by revoking pool manager role
pool.setPoolManager(address(0));
Validly Module: Deploy an AMM
Example on how to deploy a Sovereign Pool setup with the Validly Liquidity Module, configured to use Solidly's stable invariant formula, allowing low-slippage trading between USDC and USDT on Ethereum mainnet:
// Validly Factory address, 5 bips fee tier, on Ethereum mainnet
// IValidlyFactory can be imported from:
// https://github.com/ValantisLabs/Validly/blob/main/src/interfaces/IValidlyFactory.sol
IValidlyFactory validlyFactory = IValidlyFactory(0x1896d56F083ec50988d7F9edf204c2AE08b4409a);
// IMPORTANT: Ensure that token0 and token1 are ordered (token0 < token1)
// USDC
address token0 = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;
// USDT
address token1 = 0xdAC17F958D2ee523a2206206994597C13D831ec7;
// Deploys the AMM logic using Solidly's stable invariant formula,
// suitable for low slippage trading between stablecoins
// See Validly docs and https://github.com/ValantisLabs/Validly/blob/main/src/Validly.sol#L347-L353
address isStable = true;
// Automatically deploys a Sovereign Pool with the Validly Liquidity Module
address validly = validlyFactory.createPair(token0, token1, isStable);
// Retrieve address of its respective Sovereign Pool
bytes32 poolKey = keccak256(abi.encode(token0, token1, isStable));
address pool = validlyFactory.pools(poolKey);