PROPELOO

DEX DEVELOPMENT / DECENTRALISED EXCHANGE

Build a DEX where liquidity providers earn and traders trust the price.

PROPELOO engineers decentralised exchanges — from AMM smart contract design (constant product, concentrated liquidity, stable swap) through frontend trading interface, liquidity mining programme and the oracle architecture that protects liquidity providers from impermanent loss. A DEX is not a Uniswap fork. It is a protocol with its own economic model.

A DEX fork without economic differentiation will have no liquidity the day your incentive programme ends.

The DeFi graveyard is full of DEXes that launched as Uniswap forks with higher rewards, attracted mercenary liquidity during the incentive period, and lost 95% of TVL when emissions ended. A DEX that survives long-term requires economic differentiation: a novel AMM design that improves capital efficiency for specific asset classes, genuine trade volume that generates fee revenue for liquidity providers, protocol governance that gives LPs a say in fee parameters, or ecosystem integration that makes the DEX the default trading venue for a specific community. PROPELOO designs DEXes starting with the economic model — what makes this DEX the right choice for liquidity providers and traders beyond the incentive rate?

The DEX engineering stack.

System Layers

  • AMM Contract Layer: Pool creation, swap logic, liquidity management, fee calculation, price oracle
  • Protocol Layer: Factory contract, router contract, governance, fee distribution, protocol upgrades
  • Liquidity Layer: LP token mechanics, range orders (CLMM), liquidity mining contracts
  • Integration Layer: Aggregator compatibility, bridge integration, lending protocol integration
  • Frontend Layer: Swap interface, liquidity management, analytics dashboard, portfolio tracking

Core Technical Capabilities

  • AMM Design & Engineering

    Constant product AMM (xy=k, Uniswap v2 model), concentrated liquidity market maker (CLMM, Uniswap v3 model), stable swap (Curve model for like-assets), custom AMM curves for specific asset classes.

  • Concentrated Liquidity

    Uniswap v3-style concentrated liquidity — LPs provide liquidity in price ranges, earning fees proportional to in-range trade volume with significantly higher capital efficiency than constant product.

  • Smart Router

    Optimal route finding across multiple pools and liquidity sources — split routing, multi-hop, gas cost optimisation, price impact minimisation and integration with 1inch/0x aggregator APIs.

  • Liquidity Mining Contracts

    LP staking contracts with configurable emission schedules, boost mechanisms (veToken, time-weighted), multi-reward token distribution and anti-mercenary lock mechanics.

  • Protocol Governance

    Fee switch governance (protocol fee allocation), gauge voting for liquidity incentive allocation, timelock-controlled parameter changes, veToken mechanics for aligned governance.

  • DEX Analytics

    Pool TVL, volume, fees, APR tracking. LP position analytics (impermanent loss calculation, fees earned). Token price history, trade history. The Graph subgraph for queryable DEX data.

How we think about DEX design.

AMM design is mechanism design. The choice of AMM curve determines capital efficiency, impermanent loss exposure and which asset classes the DEX is optimal for.

  • AMM curve determines the DEX's ideal asset class

    Constant product (xy=k) is capital-inefficient but price-range-agnostic — suitable for volatile asset pairs where liquidity across the full price range is needed. Concentrated liquidity (CLMM) is capital-efficient for narrow price ranges — optimal for stable-to-volatile pairs with predictable price. Stable swap (Curve) is capital-efficient for same-denomination assets (USDC/USDT, stETH/ETH). Each DEX should optimise for one asset class first.

    Axiom:

  • Impermanent loss is a feature, not a bug

    Impermanent loss (the loss LPs experience from price movement vs holding the assets) is the cost LPs pay for earning fees. A DEX where LPs consistently earn more in fees than they lose to impermanent loss attracts and retains liquidity. This requires genuine trade volume. Volume comes from being the deepest liquidity source for specific trading pairs — which requires being the best DEX for LPs to deposit in the first place. Solve the chicken-and-egg with targeted liquidity incentives for specific pairs.

    Axiom:

  • Oracle security determines protocol security

    DEX protocols that use their own pool price as an oracle for collateral valuation or other protocol logic are vulnerable to flash loan price manipulation. Time-weighted average prices (TWAP) are more manipulation-resistant. External oracle integration (Chainlink, Pyth) is the safest for any protocol where the DEX price affects liquidation or minting decisions.

    Axiom:

  • Cross-chain liquidity is a distribution strategy

    Deploying a DEX on multiple EVM chains (Arbitrum, Base, Polygon) or via LayerZero unified liquidity allows the protocol to serve users wherever they have assets, without requiring them to bridge. Each chain deployment is an additional engineering and liquidity management commitment — prioritise chains where your target trading pairs have native user bases.

    Axiom:

DEX architecture decisions.

  • AMM model?

    Impact: Constant product for general-purpose volatile pair DEX (easiest to implement, widest LP compatibility). Concentrated liquidity for DEXes competing on capital efficiency. Stable swap for stablecoin or LST pairs.

    • Constant product (xy=k) — Uniswap v2 style, simple, inefficient
    • Concentrated liquidity (CLMM) — Uniswap v3 style, capital efficient, complex
    • Stable swap (A parameter) — Curve style, optimal for pegged assets
    • Custom curve — specific use case, full audit responsibility
  • Uniswap v2 fork vs v3 vs custom?

    Impact: Uniswap v2 fork for fastest launch with well-understood security. v3 for capital efficiency differentiation. Custom AMM only if there is a specific mechanism that neither v2 nor v3 provides.

    • Uniswap v2 fork — proven, simple LPs, well-understood, audited codebase
    • Uniswap v3 fork — higher capital efficiency, complex LP management
    • Custom (based on Uniswap) — differentiated features, requires audit
    • Curve fork — for stable/correlated assets, different curve mathematics
  • Governance model?

    Impact: veToken governance for DEXes that want to create a tokenomics flywheel — protocols bribe veToken holders to direct emissions to their pools. Creates sustainable token demand.

    • No governance (immutable) — simplest, cannot change parameters
    • Multisig governance — team control, fast but centralised
    • Token governance + timelock — decentralised, slow
    • veToken governance (gauge voting) — aligned incentives, Curve-style
  • Fee structure?

    Impact: Multiple fee tiers allow LPs to set appropriate fees for different asset volatility classes. Protocol fee (10-25% of trading fees to protocol treasury) funds ongoing development and governance.

    • Single fee tier (0.3%) — simple, Uniswap v2 standard
    • Multiple fee tiers (0.05%, 0.3%, 1%) — Uniswap v3 standard, optimal per asset class
    • Dynamic fees (adjusts with volatility) — sophisticated, better for LPs
    • Protocol fee (part goes to treasury) — sustainability funding
  • Chain(s)?

    Impact: Single L2 (Base or Arbitrum) for launch — concentrate liquidity on one chain before expanding. Multi-chain after proving the protocol on one chain.

    • Ethereum mainnet only — highest liquidity, highest gas
    • Ethereum L2 (Arbitrum/Base/Optimism) — low gas, growing DEX ecosystem
    • Multiple EVM chains — wider reach, liquidity fragmentation
    • Solana — different program model (Rust/Anchor), different ecosystem
  • Liquidity incentive programme?

    Impact: Token emission to LP stakers for bootstrap period (6-12 months), transitioning to veToken gauge voting as the protocol matures. The bribe market (Convex for Curve-style DEXes) is where sustainable DEX incentives come from.

    • No incentives — organic only, slow growth
    • Token emission to LP stakers — attracts TVL, token inflation risk
    • veToken boost (higher rewards for locked tokens) — Curve model, aligned
    • Bribing market (direct incentives to voters) — external protocols fund your liquidity

What PROPELOO builds.

  • General-purpose DEX

    Uniswap v2-style constant product AMM with factory, router, LP tokens, liquidity mining and trading frontend for volatile pair trading.

  • Concentrated Liquidity DEX

    Uniswap v3-style CLMM with tick-based liquidity, position NFTs, range orders, multi-fee tiers and position management interface.

  • Stablecoin DEX

    Curve-style stable swap for USDC/USDT/DAI, LST pairs (stETH/ETH) or pegged asset trading with high capital efficiency.

  • Multi-chain DEX

    DEX deployed across multiple EVM chains with unified TVL tracking, consistent UI and cross-chain liquidity bridging.

  • Aggregator-integrated DEX

    DEX built with 1inch/0x aggregator compatibility from day one — ensuring your liquidity is accessible to the widest possible trader base.

  • DEX with veToken Governance

    Full veToken governance implementation — vote-escrowed staking, gauge controller, bribing infrastructure and weekly reward distribution.

The DEX engineering stack.

  • Smart Contracts

    Stack: Solidity 0.8+, Foundry (testing + fuzz), Echidna (invariant testing), Hardhat, OpenZeppelin

  • AMM References

    Stack: Uniswap v2/v3 (reference), Curve Finance (stable swap), Balancer (weighted pools), SushiSwap (MasterChef)

  • Solana

    Stack: Rust + Anchor, Raydium (reference), Orca Whirlpools (CLMM), Serum (order book)

  • Frontend

    Stack: React / Next.js, wagmi + viem, The Graph (subgraph), TradingView (charts)

  • Analytics

    Stack: The Graph (subgraph), Dune Analytics, Custom analytics API, DefiLlama integration

  • Infrastructure

    Stack: IPFS (frontend hosting), Vercel / Cloudflare Pages, Alchemy / Infura (RPC), Tenderly (monitoring)

DEX security prevents the most catastrophic on-chain losses.

  • Reentrancy in swap callbacks

    Uniswap v2/v3 use callbacks for flash swaps. Reentrancy during these callbacks can drain pools. ReentrancyGuard on all external functions that make callbacks. Checks-effects-interactions pattern throughout.

  • Flash loan price manipulation

    DEX spot prices can be manipulated via flash loans. Any protocol using DEX spot price for collateral valuation or minting is vulnerable. Use TWAP oracles for any price-sensitive protocol logic.

  • Concentrated liquidity edge cases

    CLMM contracts have complex edge cases: liquidity at tick boundaries, price crossing between initialised ticks, full-range liquidity calculations. Fuzz testing with Echidna for all price range scenarios.

  • Infinite loop prevention

    Router contracts that iterate over routes must have maximum hop limits. Malicious token contracts can cause infinite callbacks in poorly designed routers.

  • Token fee-on-transfer compatibility

    DEX contracts that assume received amount equals sent amount break with fee-on-transfer tokens. Either explicitly handle fee-on-transfer (adjusting liquidity calculations) or document incompatibility.

  • Governance attack on fee switch

    A flash loan governance attack that turns on the protocol fee and routes it to an attacker-controlled address is a real risk. Timelock on fee parameter changes, snapshot-based voting, quorum requirements.

From AMM design to live DEX.

  1. 01. AMM Design

    Curve selection, fee structure, governance model, liquidity incentive design, oracle architecture.

  2. 02. Core Contracts

    Pool, factory, router contracts. Foundry test suite. Echidna invariant testing.

  3. 03. Governance Contracts

    Governance token, timelock, gauge controller, veToken (if applicable).

  4. 04. Security Audit

    Third-party audit from DeFi-specialised firm. Economic model review.

  5. 05. Subgraph & Analytics

    The Graph subgraph for pool data, trading volume, liquidity and fee analytics.

  6. 06. Trading Frontend

    Swap interface, liquidity management UI, portfolio analytics, governance voting.

  7. 07. Launch & Liquidity

    Mainnet deployment, initial liquidity seeding, market maker onboarding, incentive programme activation.

DEX platforms we have shipped to production.

Three decentralised exchange builds with real on-chain trading volume.

  • Uniswap v3-style concentrated liquidity AMM on EVM-compatible chain

    Challenge: DeFi protocol needed an AMM with concentrated liquidity (LPs setting price ranges), a fee tier system (0.05%, 0.3%, 1%), and a frontend enabling LPs to manage positions with impermanent loss visibility.

    Architecture: Fork and extend Uniswap v3 core: tick-based liquidity accounting, position NFTs for LP shares, custom fee controller, protocol fee switch. Subgraph indexing all swaps and LP events for analytics.

    Outcome: $28M TVL at peak, 140,000 swaps in first 3 months, LP fee APR averaged 18% on major pairs.

  • On-chain order book DEX with off-chain matching and on-chain settlement

    Challenge: Trading protocol needed a DEX with professional order book UX (limit orders, stop orders, partial fills) without the gas cost of fully on-chain order books — and without custody risk from off-chain matching.

    Architecture: Off-chain matching engine maintains order book and matches trades, settlement via ZK validity proofs submitted to L1. Users sign orders with their private key — the matcher cannot steal funds, only match. Forced withdrawal escape hatch for liveness guarantee.

    Outcome: 65,000 active traders, <100ms order matching latency, gas cost 40x lower than equivalent L1 order book.

  • DEX aggregator routing across 8 chains and 25+ DEXs with best-execution engine

    Challenge: Protocol needed a cross-chain swap aggregator finding the best route across 8 EVM and non-EVM chains — comparing direct swaps, bridge-and-swap paths, and multi-hop routes — and presenting a single quote to the user.

    Architecture: Route discovery engine queries 25+ DEXs and 6 bridge protocols in parallel, simulates gas-adjusted output for each path, ranks by net output. Fallback routes if primary slips. Transaction batching for multi-step routes.

    Outcome: Average price improvement 1.8% vs single-DEX execution, $12M monthly swap volume, route success rate 99.3%.

Frequently Asked Questions

What is an AMM and how is it different from an order book?

An Automated Market Maker (AMM) uses a mathematical formula to set prices based on the ratio of assets in a liquidity pool. The most common formula is xy=k (constant product): if 100 ETH and 200,000 USDC are in a pool, multiplying them gives k=20,000,000. Any trade changes the ratio but must maintain k. Price is always determined by the current ratio. No order book, no matching engine, no maker/taker — anyone can trade against the pool at any time.

What is impermanent loss?

Impermanent loss occurs when the price of pooled assets changes relative to each other after deposit. Example: deposit 1 ETH + $2,000 USDC when ETH = $2,000. ETH doubles to $4,000. The AMM rebalances the pool to maintain k. When you withdraw, you have less ETH and more USDC than you deposited — less value than simply holding would have been. The loss is impermanent because if ETH returns to $2,000, the loss disappears. LPs accept this risk in exchange for trading fee revenue.

What is concentrated liquidity and why does it matter?

Uniswap v3 concentrated liquidity allows LPs to provide liquidity in a specified price range (e.g. ETH between $1,800 and $2,200) instead of across the full price range from $0 to infinity. This concentrates capital where trading actually happens — an LP in a narrow range earns the same fees as someone providing 100x more capital across the full range. Higher capital efficiency means better prices for traders and higher fee APR for LPs who set ranges correctly.

How long does it take to build a DEX?

A basic AMM DEX (Uniswap v2-style) with smart contracts, liquidity pool UI and basic analytics: 3–5 months. A Uniswap v3-style concentrated liquidity DEX with tick math, position NFTs and a full-featured LP management UI: 6–9 months. An order book DEX with off-chain matching and ZK proof settlement: 9–14 months. A cross-chain DEX aggregator: 6–12 months depending on chain count and routing complexity. All timelines assume a security audit (4–8 weeks) before mainnet launch.

What blockchains can you build a DEX on?

EVM chains (Ethereum, Arbitrum, Optimism, Base, Polygon, BNB Chain, Avalanche) are the most common — Solidity smart contracts deploy across all of them with minor chain-specific adjustments. Solana DEXs use Rust/Anchor programs and have a different architecture (Serum order book legacy, Raydium AMM model). Cosmos chains use CosmWasm. Near and Aptos use Move. We have shipped AMM contracts on Ethereum, Arbitrum, BNB Chain and Polygon. Chain selection depends on your target user base and gas cost requirements.

How much does it cost to build a DEX?

A basic Uniswap v2-style AMM: $80K–$180K including contracts, frontend and subgraph. A Uniswap v3-style concentrated liquidity DEX: $200K–$400K. An order book DEX with ZK settlement: $400K–$900K. A cross-chain aggregator: $250K–$600K. Smart contract security audits are an additional $15K–$80K depending on contract complexity and the audit firm (Trail of Bits, Certik, Hacken). Audits are not optional — unaudited DeFi contracts are a liability, not a launch.

What is a DEX aggregator and should I build one?

A DEX aggregator routes a swap across multiple DEXs and liquidity sources to find the best net output after gas. 1inch, Paraswap and CowSwap are the best-known. You should build an aggregator if your value proposition is best execution across an ecosystem — not if you are building a standalone AMM or order book. Aggregators require real-time price discovery across many protocols, route simulation (accounting for price impact and gas), and a split-route execution engine. They depend on the liquidity of underlying DEXs — an aggregator with thin underlying liquidity adds no value.

What oracle does a DEX use for price data?

AMM DEXs do not use external oracles for price discovery — the pool ratio determines price. However, oracles are needed for: lending protocols built on top of DEX liquidity (Chainlink or TWAP feeds for collateral valuation), options and derivatives pricing, and cross-chain price data. Time-Weighted Average Price (TWAP) oracles built into Uniswap v2/v3 pool contracts are commonly used because they are manipulation-resistant over longer windows. Chainlink provides off-chain aggregated prices and is the standard for high-value DeFi protocols.

What are the main smart contract risks in a DEX?

Reentrancy attacks: a malicious contract repeatedly calling back into the DEX before state is updated (the DAO hack, $60M). Flash loan attacks: borrowing large sums within one transaction to manipulate price oracles and drain pools. Price oracle manipulation: using low-liquidity pools as price references for lending protocols. Integer overflow/underflow: arithmetic errors in fee or liquidity calculations. Access control bugs: admin functions callable by unauthorized addresses. Mitigation: professional audit, reentrancy guards, CEI pattern (Checks-Effects-Interactions), battle-tested AMM libraries, timelocked upgrades, bug bounty programme.

Do I need a smart contract audit before launching a DEX?

Yes — always, without exception. A DEX holds real user funds on-chain. An unaudited contract has been exploited within hours of launch in numerous cases ($600M Poly Network, $320M Wormhole, $182M Beanstalk). Audits cost $15K–$80K depending on contract complexity and the firm. Reputable firms: Trail of Bits, OpenZeppelin, Certik, Hacken, Sherlock. We recommend two independent audits for any contract holding over $1M. We coordinate audit scheduling as part of our DEX delivery process so it does not delay your mainnet timeline.