Valantis Documentation
Valantis Website
  • Welcome to Valantis
  • Sovereign Pool
    • The Modules
      • Pool Manager
      • Liquidity Module
      • Swap Fee Module
      • Verifier Module
      • Oracle Module
      • Sovereign Vault
        • Rebase token support
      • Gauge
    • Interacting with Pools
      • Swap Parameters
      • Swap Steps
      • Multi Token Support
      • Deposit Liquidity
      • Withdraw Liquidity
      • Flash Loans
  • Hybrid Order Type (HOT)
    • Understanding HOT: A Graphical Overview
    • HOT API
      • HTTP request parameters
      • HTTP request response
      • Reasoning for Request structure
      • Solver Integration
      • Market Maker integration
    • HOT Smart Contracts
      • Interfaces
      • State variables and roles
      • AMM
      • HOT Swap
      • AMM Swap
      • Hybrid Order Type (HOT) struct parameters
      • Alternating Nonce Bitmap
      • Deposits
      • Withdrawals
      • Deployment Assumptions
    • Liquidity Manager Docs
      • Reference Oracle
      • Deposit
      • Withdraw
      • Signature
    • Swap
      • Swap Context
      • AMM Swap
      • HOT Swap
      • HOT Quote Parameters
        • Bitmap Nonce Instructions
    • Solver Docs
      • Solver Request
      • Simple HOT Swap Example
      • Partial Fill HOT Swap Example
    • Risks and Trust Assumptions
      • Roles
        • Sovereign Pool Manager
        • HOT Manager
        • HOT Signer
        • Liquidity Provider
      • Threats
        • Deposit Sandwich
        • Malicious Price Bound
        • Malicious Signer
        • Mispriced HOT Quote
  • Validly
    • Understanding Validly
    • Swap
    • Deposits and Withdrawals
    • Deployments
  • Stake Exchange (stHYPE AMM)
    • Swap
      • Instant Withdrawals (LST -> Native Token)
      • New Stake (Native Token -> LST)
    • LP Positions
      • LP Withdrawals Instant
      • LP Withdrawal Queued
    • Ratio Fee
    • Lending of Reserves
    • Smart contracts
      • STEXAMM.sol
      • StHYPEWithdrawalModule.sol
      • StexRatioSwapFeeModule.sol
      • DepositWrapper.sol
      • AaveLendingModule.sol
    • Risks and Trust Assumptions
    • Integration examples
  • Deploy and Build
  • Resources
    • Audits
    • Links
    • Get HYPE on HyperEVM
Powered by GitBook
On this page
  • Deployments
  • Ethereum (mainnet)
  • HyperEVM
  • Arbitrum
  • Ink
  • Base
  • Mantle
  • Morph L2
  • Sovereign Pool: Build your own DEX
  • Validly Module: Deploy an AMM

Was this helpful?

Deploy and Build

PreviousIntegration examplesNextResources

Last updated 21 days ago

Was this helpful?

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);

Sovereign Pool Factory:

Protocol Factory: Sovereign Pool Factory:

0x29939b3b2aD83882174a50DFD80a3B6329C4a603
0xa68d6c59Cf3048292dc4EC1F76ED9DEf8b6F9617
Deploy a Validly pool on Ethereum Mainnet
0xD9a406DBC1a301B0D2eD5bA0d9398c4debe68202
0x7E028ac56cB2AF75292F3D967978189698C24732
0xe105af173402b07100aE5648385E1F182bCE21B6
0x5365b6EF09253C7aBc0A9286eC578A9f4B413B7D
0x69e487aA3132708d08a979b2d07c5119Bb77F698
0x7c4fdA6476c0fd90ef9FB13919615F37Fb61dC3A
0x8392E8F0fffE031B841Ba6db06c44F7Be3EE8F26
Deploy a Validly pool on Arbitrum
0xc0c80150750d7a2852147b06c4fbc065bf1e0838
0xe00eC9684c1f140a7E7319F66FdD4c99989FE330
0xb2bB5c89aF186D88De011042063BB4e924031cbF
Deploy a Validly pool on Ink
0x739714B766b0e4Af30794980c4CB2A9150E6AeeC
0xcAC5E476a3cbE6545FB726ea4c583ace92fd5aab
0x739714B766b0e4Af30794980c4CB2A9150E6AeeC
0xAfCEb567BcbA93C0922B22Cde454d9A6AADc3fc5
0xb9cE972C7Ab91F22482cC2CAFb7badaf6F1F8949