Skip to main content

DobDex

DobDex is a zero-slippage decentralized exchange purpose-built for real-world asset (RWA) tokens. Unlike traditional AMM-based DEXes that suffer from impermanent loss and price slippage, DobDex settles every trade at the exact oracle price by leveraging Uniswap V4's Custom Accounting Hook architecture.

Live at: dex.dobprotocol.com

The Problem with Traditional DEXes for RWAs

Traditional AMM-based decentralized exchanges use a bonding curve (typically x * y = k) to determine prices. While this works well for volatile crypto assets, it creates serious problems for RWA tokens:

ProblemImpact on RWA Trading
SlippageLarge trades move the price significantly away from fair value
Impermanent lossLiquidity providers lose value when the RWA's real-world price diverges from the pool ratio
Price disconnectionAMM price can drift far from the actual asset value
Liquidation chaosForced selling into a thin AMM pool causes cascading price drops

RWA tokens represent real-world assets with known, appraised values. A solar panel array worth $50,000 should trade at $50,000 -- not at whatever price the AMM curve happens to produce.

Core Innovation

DobDex solves these problems through a single architectural decision: bypass the AMM math entirely and settle at oracle price.

The system uses a DobPegHook -- a Uniswap V4 Custom Accounting Hook -- that intercepts every swap before the AMM curve is applied. Instead of letting the constant-product formula determine the output amount, the hook calculates the exact output based on the current oracle price from the DobValidatorRegistry.

Traditional AMM:  User swaps RWA --> AMM curve calculates output --> slippage
DobDex: User swaps RWA --> Hook intercepts --> Oracle price used --> zero slippage

The result:

  • Zero slippage -- Every trade settles at the oracle-reported fair value
  • No impermanent loss -- LPs are not exposed to divergence between pool ratio and real price
  • Exact pricing -- The price is always the appraised value of the underlying asset
  • Orderly liquidations -- Liquidations happen at a controlled discount, not at market impact

Architecture

DobDex is composed of several smart contracts working together:

ContractPurpose
DobPegHookUniswap V4 Custom Accounting Hook; intercepts swaps and enforces oracle pricing
DobValidatorRegistryOn-chain oracle registry; stores asset prices from DobValidator
DobRwaVaultEscrow for RWA tokens during swaps and liquidations
DobLPRegistryManages liquidity node positions, backing conditions, and FIFO matching
DobDirectSwapLightweight swap router for chains without Uniswap V4
DobSwapRouterUser-facing router that integrates with Uniswap V4 pools
DobTokenFactoryFactory for creating dRWA (wrapped RWA) tokens

Deployment Status

ChainDeploymentV4 Support
Arbitrum SepoliaFull V4 deploymentYes (DobPegHook)
Robinhood ChainDirect swapDobDirectSwap (no V4)
Base SepoliaFull V4 deploymentYes (DobPegHook)

How It Works

Selling RWA Tokens (RWA to USDC)

  1. User deposits RWA tokens into the DobRwaVault
  2. DobPegHook reads the asset's oracle price from DobValidatorRegistry
  3. Hook calculates the exact USDC amount: amount = rwaTokens * oraclePrice
  4. USDC is transferred from the vault's liquidity reserves to the user
  5. RWA tokens remain in the vault, backed by LP positions

Buying RWA Tokens (USDC to RWA)

  1. User deposits USDC
  2. DobPegHook reads the oracle price
  3. Hook calculates the exact RWA token amount: tokens = usdcAmount / oraclePrice
  4. RWA tokens are transferred from the vault to the user

Oracle Price Updates

Asset prices are updated through the DobValidatorRegistry, which serves as the on-chain oracle:

  • Prices originate from DobValidator's TRUFA scoring and appraisal process
  • Authorized validators can update prices on-chain
  • A staleness circuit breaker (MAX_ORACLE_DELAY = 1 day) automatically pauses trading if the oracle price has not been updated recently
  • This prevents trades at stale or manipulated prices

Key Properties

PropertyDescription
Zero slippageTrades execute at exact oracle price regardless of size
No impermanent lossLP positions are not subject to AMM divergence
Oracle-backed pricingEvery price comes from validated asset appraisals
Orderly liquidationsControlled discount mechanism instead of market-impact selling
Permissionless LPsAnyone can provide liquidity with customizable conditions
Circuit breakerAutomatic pause on stale oracle data

Test Coverage

The DobDex contract suite has comprehensive test coverage:

  • 77 tests passing across the full contract suite
  • Tests cover swap mechanics, hook behavior, liquidation flows, LP management, and edge cases
  • Fuzz testing for oracle price boundaries and vault accounting

Next Steps