PROPELOO

HYBRID EXCHANGE / CEX + DEX ARCHITECTURE

Build an exchange with CEX performance and DEX custody.

PROPELOO engineers hybrid cryptocurrency exchanges — centralised order matching with decentralised custody and settlement. Users keep self-custody of their funds while the exchange provides the performance, liquidity and user experience of a centralised exchange. This is the architecture that resolves the CEX-vs-DEX tradeoff.

The FTX collapse demonstrated why CEX custody is a systemic risk. The DEX gas cost problem explains why pure on-chain trading is not the answer.

Centralised exchanges require users to trust the exchange with their funds — a trust that FTX proved cannot be assumed. Pure DEXes require paying gas for every trade, suffer from MEV sandwich attacks, and cannot match the performance needed for professional trading. Hybrid exchanges solve both problems: the matching engine runs off-chain for speed and efficiency, but user funds remain in self-custody smart contract accounts, and settlement is cryptographically verified on-chain. Users cannot be rugged because the exchange never holds their assets. Traders get CEX-level performance because matching is centralised.

The hybrid exchange architecture.

System Layers

  • Matching Layer (off-chain): Central matching engine — price-time priority, all order types, sub-millisecond latency
  • Custody Layer (on-chain): Smart contract vaults — user funds never leave user-controlled contracts
  • Settlement Layer (on-chain): Verified settlement — batch settlement proofs, ZK validity proofs, optimistic fraud proofs
  • API Layer: Standard trading API — REST, WebSocket, FIX protocol compatibility
  • User Interface: Professional trading UI — same UX as CEX, with self-custody indicators

Core Technical Capabilities

  • Off-chain Matching Engine

    High-performance central matching engine processing 50K+ orders/second with sub-millisecond latency. All standard order types. Users sign orders with their wallet key — matching engine cannot submit unauthorised orders.

  • On-chain Settlement

    Periodic batch settlement on-chain: balances of matched trades committed to smart contracts. Settlement can be validated cryptographically — anyone can verify that settlement matches the off-chain trade log.

  • ZK Settlement (Advanced)

    ZK rollup settlement — validity proofs submitted on-chain proving that all state transitions are correct. Users can force-withdraw from the ZK contract even if the operator is offline. Maximum trust.

  • Non-custodial Wallet Integration

    MetaMask, WalletConnect, hardware wallets, ERC-4337 smart accounts — users connect their existing self-custody wallets. Deposits stay in user-controlled smart contracts.

  • Forced Withdrawal

    Even if the exchange operator disappears or becomes malicious, users can trigger a forced withdrawal from the on-chain smart contract after a time delay. The exchange cannot block it.

  • Trade Verification

    Every trade is cryptographically verifiable: signed by both parties (or the matching engine acting under user's signed delegation), committed on-chain in a Merkle tree, queryable by any observer.

How we think about hybrid exchange design.

The hybrid exchange design goal is: the exchange operator should be unable to steal user funds even with full control of the system.

  • Order signing prevents unauthorised trades

    In a hybrid exchange, users sign each order (or sign a delegation key) with their wallet. The matching engine cannot submit trades that the user did not authorise. Even if the matching engine is compromised, it cannot move user funds without valid user signatures. This is the core security property that distinguishes hybrid from CEX.

    Axiom:

  • Settlement proof frequency determines user latency risk

    The longer between on-chain settlements, the larger the window in which the operator could theoretically go offline with unconfirmed user balances. Hourly settlement balances gas cost against user risk. Real-time settlement (ZK validity proofs) eliminates the window but requires ZK infrastructure (dYdX v4 StarkEx model).

    Axiom:

  • Forced withdrawal is the user's safety valve

    Even with periodic settlement, users need a way to exit even if the operator goes offline. The escape hatch: after the settlement period passes without a new commitment, any user can trigger a withdrawal from the last committed on-chain balance. The operator cannot block this. This feature is what makes the hybrid model trustless, not just self-custody.

    Axiom:

  • Gas cost is the hybrid model's main challenge

    Every batch settlement transaction costs gas. More frequent settlement means more gas costs, which either reduces profitability or increases fees. ZK rollup settlement (single proof per batch of thousands of trades) amortises gas cost effectively. Optimistic settlement with fraud proofs is simpler to implement.

    Axiom:

Hybrid exchange architecture decisions.

  • Settlement mechanism?

    Impact: ZK rollup for highest trust guarantees (dYdX v4, Stark-based). Optimistic for faster development timeline. Batch commit without proofs if on-chain verification is not a requirement — suitable for exchanges where the operator is trusted but funds are self-custodied as a safety net.

    • Optimistic (fraud proofs) — simpler, requires challenge period
    • ZK rollup (validity proofs) — trustless, complex, no challenge period
    • Batch commit without proofs — cheapest, weaker trust guarantees
    • StarkEx (dYdX v3 model) — proven at scale, licensing required
  • Layer 2 or L1 settlement?

    Impact: Arbitrum or Base for most hybrid exchanges — EVM compatible, low gas costs, established ecosystem. StarkNet for ZK-native settlement. Ethereum L1 only for very high-value protocols where L2 trust is insufficient.

    • Ethereum L1 — highest security, high gas cost for settlement
    • Arbitrum/Optimism (L2) — lower gas, inherits L1 security
    • StarkNet — ZK settlement native, higher complexity
    • Custom L1/L2 — maximum performance, bootstrapping challenge
  • Order signature model?

    Impact: Session key delegation or ERC-4337 smart account for production — requiring MetaMask popups for every trade is unusable. Session keys allow professional trading UX while maintaining self-custody security.

    • Per-order signing — most security, poor UX (wallet popup per trade)
    • Session key delegation — sign once per session, good UX
    • ERC-4337 smart account — gasless, session keys, best UX
    • API key with on-chain binding — CEX-like UX, requires smart contract
  • Supported chains?

    Impact: Single L2 at launch (Base or Arbitrum). Cross-chain after proving the protocol — cross-chain hybrid exchanges require solving cross-chain settlement consistency which is significantly complex.

    • Single chain (Ethereum or L2) — simplest
    • Multi-chain EVM — same contract, multiple deployments
    • Cross-chain (CCIP/LayerZero) — unified order book across chains
    • Solana — high performance, different architecture
  • Asset support?

    Impact: Start with native chain assets (ETH, USDC, USDT, major ERC-20). Add bridged assets after launch when compliance with bridge security risks is evaluated.

    • Native ETH + ERC-20 only — simplest
    • EVM multi-chain assets — broad coverage
    • Bridged BTC (WBTC/tBTC) — includes Bitcoin liquidity
    • Real-world assets (tokenised) — institutional use case

What PROPELOO builds.

  • dYdX-style Hybrid Exchange

    Off-chain CLOB matching + ZK or optimistic on-chain settlement with forced withdrawal guarantee and non-custodial wallet integration.

  • Hybrid Spot DEX

    Spot trading with off-chain order book for professional trading UX + on-chain settlement and self-custody of all user assets.

  • Hybrid Derivatives Exchange

    Perpetuals and futures with CEX-level matching performance + on-chain risk management and user-owned position contracts.

  • Institutional Hybrid Exchange

    Hybrid exchange for institutional clients — FIX protocol, batch settlement designed for audit requirements, enhanced KYB, OTC desk.

  • Hybrid Exchange on L2

    Deploy existing CEX matching engine with on-chain settlement layer on Arbitrum/Base — add self-custody guarantee to existing trading infrastructure.

  • Cross-chain Hybrid DEX

    Unified order book across multiple chains — user assets stay on their preferred chain, trades settle cross-chain via LayerZero or CCIP.

The hybrid exchange stack.

  • Matching Engine

    Stack: Go / Rust (off-chain engine), Redis (order book state), Kafka (event log)

  • Settlement (ZK)

    Stack: StarkEx, zkSync (ZK Stack), Polygon zkEVM, Linea

  • Settlement (Optimistic)

    Stack: Custom fraud proof contracts, Arbitrum SDK, Dispute resolution

  • Smart Contracts

    Stack: Solidity (custody), OpenZeppelin, Foundry + Echidna, ERC-4337 (session keys)

  • Frontend

    Stack: React + TradingView, wagmi + viem, WalletConnect v2, Session key SDK

  • Infrastructure

    Stack: AWS multi-region, Kubernetes, Tenderly (monitoring), Datadog

Hybrid exchange security: the operator cannot steal funds.

  • Forced withdrawal guarantee

    The core security property: smart contract must allow any user to withdraw their assets after the settlement deadline passes, regardless of operator cooperation. Test this path rigorously — it must work when the operator is actively resisting.

  • Order signature security

    Session key delegation: signed permission for a specific key to trade on behalf of the user wallet, with value limits and expiry. If the session key is compromised, losses are bounded by the session key parameters.

  • Settlement proof verification

    For ZK settlement: the validity proof must be verified on-chain for every batch. Invalid state transitions must be rejected. For optimistic: robust fraud detection and incentivised challengers.

  • Smart contract audit

    Custody contracts, settlement contracts and forced withdrawal mechanisms require full third-party audit. The security model depends entirely on these contracts being correct.

  • Operator key management

    The operator signing key for batch settlement must be HSM-backed with multi-party approval for emergency operations. A compromised signing key cannot steal funds (user assets self-custodied) but can halt settlement.

  • Economic attacks

    The settlement incentive structure must prevent the operator from selectively withholding settlements to harm specific users. Time-based forced settlement prevents this.

From design to live hybrid exchange.

  1. 01. Architecture Design

    Settlement mechanism, custody model, order signing, L2 selection, forced withdrawal design.

  2. 02. Smart Contracts

    Custody contracts, settlement contracts, forced withdrawal logic.

  3. 03. Matching Engine

    Off-chain order book, order validation (signature check), batch settlement preparation.

  4. 04. Settlement Infrastructure

    ZK prover (if applicable), batch commitment, on-chain state update.

  5. 05. Wallet Integration

    Non-custodial wallet connection, session key implementation, deposit/withdrawal UX.

  6. 06. Trading Interface

    Professional trading UI, self-custody indicators, forced withdrawal UI.

  7. 07. Security Audit & Launch

    Smart contract audit, settlement mechanism security review, staged launch.

Frequently Asked Questions

What is a hybrid exchange?

A hybrid exchange combines a centralised order book (for speed and professional trading UX) with on-chain settlement and self-custody of user funds (for security). The matching happens off-chain like a CEX — fast and efficient. But user funds are held in smart contracts that only the user controls. The exchange cannot withdraw user funds without user signatures. Settlement is committed on-chain so anyone can verify correctness.

How does forced withdrawal work?

When a user's funds are committed on-chain in the latest settlement proof, the smart contract maintains that balance. If the operator stops processing withdrawals or disappears, users can trigger a forced withdrawal: submit a transaction to the smart contract claiming their on-chain committed balance after a waiting period (typically 24-72 hours). The operator cannot block this withdrawal. This is the safety valve that makes the hybrid model trustless.

Why is this better than a regular DEX?

A hybrid exchange provides CEX-level performance (sub-millisecond matching, all order types, no gas per trade) with self-custody security. A pure DEX pays gas for every trade (expensive on L1), suffers from MEV sandwich attacks, has slower settlement, and cannot offer limit orders without significant complexity. The hybrid model is better for professional trading use cases where order book dynamics and execution quality matter.