Skip to main content

Overview

CLAMM, as part of the Hyper-CLAMM engine in the Morpheum ecosystem (a gasless, DAG-based Layer 1 chain), is designed for decentralized spot trading in a CLOB DEX environment. It draws from Uniswap V3’s concentrated liquidity model, Balancer V3’s boosted pools and hooks, and ReClamm’s virtual balance adjustments for enhanced capital efficiency (up to 250–300× compared to constant product AMMs like Uniswap V2). This makes it ideal for scenarios where liquidity providers (LPs) want precise price range control, automatic rebalancing, and composability with staking or yield-bearing assets. CLAMM excels in spot markets for both native L1 tokens and cross-chain synthetics (e.g. wETH, wBTC, wXRP via oracles and bridges like Hyperlane). It is not suited for perpetuals or high-leverage derivatives (those would use a separate CLOB module), but it is optimized for AMM–CLOB hybrids where low-slippage trades are needed. Below are suitable use cases, categorized by volume and market cap, based on the system’s design principles (e.g. from hyper_clamm_system_design.md and reclamm-features.md). These are informed by performance bounds: sharded throughput of 10k+ TPS per shard (100–200 shards total, yielding 100k–2M TPS practical), sub-100ms latency, and capital efficiency that scales with pool depth.

1. Volume-wise suitability

CLAMM handles high concurrency via per-pool locking and DAG-async processing, making it scalable for varying trade volumes. It uses O(log n) tick iteration for swaps, ensuring efficiency even in deep books.

2. Market cap–wise suitability

Market cap influences pool TVL and IL risks. CLAMM’s virtual balances and range-bound liquidity make it efficient across caps, but it works best for assets where LPs can predict ranges (e.g. stables or established tokens).

General recommendations

  • Best overall: Medium–high volume mid–large cap assets (e.g. 10M10M–1B cap with 5M+ daily volume) where concentrated liquidity shines—e.g. stablecoin farms or cross-chain hubs. Avoid ultra-low volume (<100K daily) unless hooks incentivize activity.
  • Efficiency gains: In simulations (from reclamm-features.md), CLAMM achieves 200–300× capital efficiency for volatile pairs (e.g. memes) and 100% utilization for stables via boosted pools.
  • Cross-chain specifics: For tokens like ETH/BTC/XRP (from spot-engine.md), use oracle-seeded virtuals without local LP funding—suitable for any volume/cap, but cap virtual dominance at 95% to mitigate oracle risks.

Implementation reference (Golang)

The system designs in the provided documents (e.g. hyper_clamm_system_design.md, phase2-todos.md, hooks_documentation.md) reference a modular Golang structure under pkg/modules/clamm/. Key files and programs relevant to CLAMM implementation and use cases:
  • Core keeper logicpkg/modules/clamm/keeper/keeper.go — Manages state (pools, positions); integrates with DAG for async swaps. Use for volume handling (e.g. per-pool locking for high TPS).
  • Swap operationspkg/modules/clamm/keeper/swap.go — Implements exact-in/out swaps with tick iteration; optimized for medium–high volume via O(log n) algorithms.
  • Liquidity managementpkg/modules/clamm/keeper/liquidity.go — Handles add/remove liquidity; key for boosted pools in large-cap use cases.
  • ReClamm mathpkg/modules/clamm/math/reclamm_math.go — Virtual balance and glide calculations; essential for volatile small-cap memes.
  • Hooks systempkg/modules/clamm/hooks/base_hook.go and pkg/modules/clamm/types/interfaces.go — Extensibility for custom use cases (e.g. Volatility Fee Hook for mid-cap volatility).
  • Query handlerspkg/modules/clamm/keeper/grpc_query_server.go — Read operations like get_pool_info; low-latency for market cap queries.
  • Integration points:
    • consensus/pipeline/stages/validation/oracle_integration.go — For cross-chain oracles in synthetic pools.
    • pkg/modules/staking-interest/module.go — Staking LP shares for yield in all caps.
  • Testing / programstest/clob_framework/test_scenarios.go — Simulates volume and market cap scenarios (e.g. 1M trades/day for mid-cap pools).
For code snippets, patches, or a prototype (e.g. a simple CLI in Golang to simulate a CLAMM pool for a specific use case like a $10M meme coin), refer to the internal system design and phase documentation or the morphcore repository.