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:
| Problem | Impact on RWA Trading |
|---|---|
| Slippage | Large trades move the price significantly away from fair value |
| Impermanent loss | Liquidity providers lose value when the RWA's real-world price diverges from the pool ratio |
| Price disconnection | AMM price can drift far from the actual asset value |
| Liquidation chaos | Forced 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:
| Contract | Purpose |
|---|---|
| DobPegHook | Uniswap V4 Custom Accounting Hook; intercepts swaps and enforces oracle pricing |
| DobValidatorRegistry | On-chain oracle registry; stores asset prices from DobValidator |
| DobRwaVault | Escrow for RWA tokens during swaps and liquidations |
| DobLPRegistry | Manages liquidity node positions, backing conditions, and FIFO matching |
| DobDirectSwap | Lightweight swap router for chains without Uniswap V4 |
| DobSwapRouter | User-facing router that integrates with Uniswap V4 pools |
| DobTokenFactory | Factory for creating dRWA (wrapped RWA) tokens |
Deployment Status
| Chain | Deployment | V4 Support |
|---|---|---|
| Arbitrum Sepolia | Full V4 deployment | Yes (DobPegHook) |
| Robinhood Chain | Direct swap | DobDirectSwap (no V4) |
| Base Sepolia | Full V4 deployment | Yes (DobPegHook) |
How It Works
Selling RWA Tokens (RWA to USDC)
- User deposits RWA tokens into the DobRwaVault
- DobPegHook reads the asset's oracle price from DobValidatorRegistry
- Hook calculates the exact USDC amount:
amount = rwaTokens * oraclePrice - USDC is transferred from the vault's liquidity reserves to the user
- RWA tokens remain in the vault, backed by LP positions
Buying RWA Tokens (USDC to RWA)
- User deposits USDC
- DobPegHook reads the oracle price
- Hook calculates the exact RWA token amount:
tokens = usdcAmount / oraclePrice - 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
| Property | Description |
|---|---|
| Zero slippage | Trades execute at exact oracle price regardless of size |
| No impermanent loss | LP positions are not subject to AMM divergence |
| Oracle-backed pricing | Every price comes from validated asset appraisals |
| Orderly liquidations | Controlled discount mechanism instead of market-impact selling |
| Permissionless LPs | Anyone can provide liquidity with customizable conditions |
| Circuit breaker | Automatic 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
- Zero-Slippage Mechanism -- Deep dive into the DobPegHook architecture
- Liquidity Nodes -- How the permissionless LP system works
- Liquidations -- Orderly liquidation mechanism for RWA tokens