How dobdex Works

A deep dive into the protocol architecture: how real-world assets are tokenized, priced by oracles, swapped at a 1:1 peg via Uniswap V4 Custom Accounting, and backed by permissionless liquidity nodes.

Ecosystem Architecture Contracts Oracle Swap Flow Liquidation Liquidity Nodes Trust Flywheel Safety

Ecosystem

From Real World to On-Chain Liquidity

Dobdex is the final step in the Dobprotocol pipeline. Three products work together to bring real-world assets on-chain.

1
Validate

DobValidator

Asset owners register their real-world assets. Dobprotocol's AI agents validate them, assess their value, and create oracle price feeds.

Asset registration AI validation Oracle price feeds
validator.dobprotocol.com ↗
2
Tokenize

Token Studio

Validated assets are tokenized into ERC-20 participation tokens. Each token represents fractional ownership of the underlying real-world asset.

ERC-20 creation Fractional ownership Distribution contracts
tokenize.dobprotocol.com ↗
3
Trade

Dobdex

Dobprotocol lists the token on the DEX. Users deposit RWA tokens, mint dobRWA, and swap at a 1:1 oracle peg with zero slippage. LPs provide exit liquidity.

1:1 peg swaps Liquidation engine Permissionless LPs
dex.dobprotocol.com ↗
Real-world asset  →  ERC-20 token  →  dobRWA  →  USDC

Architecture

Dobdex Contracts

Four smart contracts work together to create a trustless RWA liquidity layer on top of Uniswap V4.

Entry Point

RWA Token Holders

Users holding tokenized real-world assets (DCT, SFT, RET, PWG)

Entry Point

USDC Liquidity Providers

LPs depositing USDC to back assets and earn discounted dobRWA

deposit RWA deposit USDC
DobRwaVault

RWA Vault

Accepts RWA deposits, queries oracle, mints dobRWA at oracle price

DobPegHook

Uniswap V4 Hook

NoOp custom accounting: executes dobRWA/USDC swaps at exact 1:1 peg

DobLPRegistry

LP Registry

Permissionless LP system with conditional fills and FIFO ordering

reads prices
DobValidatorRegistry

Oracle & Liquidation Registry

AI validator agents submit USD prices for each RWA. Controls liquidation mode, penalty rates, and per-asset & global caps.


Smart Contracts

Contract Details

Each contract has a single responsibility, composed together for the full protocol.

🏦
DobRwaVault.sol
ERC-20 + Vault
The vault is both the RWA depository and the dobRWA token itself (inherits ERC-20). When a user deposits an approved RWA token, the vault queries the DobValidatorRegistry oracle for its USD price and mints amount * priceUsd / 1e18 dobRWA tokens. Minted dobRWA represents a unified, fungible claim on the underlying basket of real-world assets.
deposit() addApprovedAsset() burn() setHook()
🔎
DobValidatorRegistry.sol
Oracle + Liquidation Config
On-chain oracle managed by Dobprotocol. Maps each RWA token to a 18-decimal USD price with a freshness timestamp. Dobprotocol's AI validator agents update prices as asset values change. Also stores liquidation parameters per asset: whether liquidation mode is enabled, the penalty rate in basis points, per-asset caps, and a global cap across all assets.
setPrice() getPrice() setLiquidationParams() recordLiquidation()
DobPegHook.sol
Uniswap V4 Hook
The core innovation. A Uniswap V4 Custom Accounting Hook that intercepts every swap via beforeSwap and executes it off-AMM at an exact 1:1 oracle-pegged rate. Uses the NoOp pattern: settles output tokens and mints ERC6909 claims for input tokens, creating zero-net deltas. In liquidation mode, applies a penalty discount and routes fills through the LP Registry.
_beforeSwap() seedUsdc() releaseDobRwa() unlockCallback()
💰
DobLPRegistry.sol
Permissionless LP System
LPs deposit USDC and set per-asset conditions: minimum oracle price, minimum penalty, max exposure, and USDC allocation. During liquidations, the hook calls queryAndFill which iterates backers in FIFO order, checks conditions, and fills willing LPs. LPs receive discounted dobRWA (buy at penalty price), claimable via the hook's ERC6909 burn mechanism.
register() backAsset() queryAndFill() claimDobRwa()

Oracle

Oracle & Asset Onboarding

Assets don't appear on their own. Dobprotocol's AI validator agents manage the full lifecycle: approval, pricing, and liquidation triggers.

1
Asset Registration

Dobprotocol registers the RWA token price

Dobprotocol's AI validator agents evaluate the real-world asset and publish its USD price on-chain. Only Dobprotocol can set and update prices — this is not self-service.

DobValidatorRegistry.setPrice(tokenAddress, priceUsd)
2
Vault Approval

Dobprotocol whitelists the token in the Vault

Dobprotocol adds the RWA token to the DobRwaVault's approved list. Only approved tokens can be deposited by users.

DobRwaVault.addApprovedAsset(tokenAddress)
3
Active

Users can deposit RWA and mint dobRWA

With price set and token approved, users can deposit the RWA token. The vault reads the oracle price and mints dobRWA proportional to the asset's valuation. Dobprotocol continuously updates the price as the real-world asset's value changes.

mintAmount = (amount * priceUsd) / 1e18
4
If Distressed

Dobprotocol can activate liquidation mode

If the underlying RWA becomes distressed, Dobprotocol enables liquidation mode with a penalty rate and cap. This triggers the liquidation engine for that asset, allowing distressed sellers to exit at a discount.

DobValidatorRegistry.setLiquidationParams(token, penaltyBps, cap)
Dobprotocol manages the oracle
Users cannot register their own RWA assets or set prices. Dobprotocol is the sole authority for price feeds, asset approvals, and liquidation triggers. Real-world asset valuation requires off-chain verification — Dobprotocol's AI validator agents handle this, bridging the off-chain assessment to on-chain price updates.

Core Mechanism

Selling RWA: The Secondary Sale

Dobdex is a secondary sale liquidity layer. Asset holders sell their RWA positions for USDC. There is no buy-side — purchasing RWA tokens happens on Token Studio.

Normal Mode

1:1 Peg Swap

Asset is healthy. User sells dobRWA and receives USDC at exact 1:1 rate. USDC comes from the hook's own reserves (seeded by the protocol).

Liquidity Nodes: NOT involved
Liquidation Mode

Penalty Swap

Asset is distressed. User sells dobRWA at a discount (e.g., -20%). USDC comes from Liquidity Node LPs who earn discounted dobRWA in return.

Liquidity Nodes: ACTIVE (queryAndFill)

Normal Sale Flow (step by step)

1
Deposit & Mint

User deposits RWA into the Vault

A user holding a tokenized real-world asset (e.g., DCT representing debt certificates) deposits it into DobRwaVault. The vault queries the DobValidatorRegistry for the current USD price and mints dobRWA proportional to the asset's oracle valuation.

mintAmount = (amount * priceUsd) / 1e18
2
Swap Initiated

User swaps dobRWA for USDC on Uniswap V4

The user initiates a standard Uniswap V4 swap on the dobRWA/USDC pool. Because DobPegHook is attached with the beforeSwapReturnDelta flag, the hook intercepts the swap before the AMM executes.

params.amountSpecified < 0 // exact-input only
3
NoOp Custom Accounting

Hook settles the swap at 1:1 peg

The hook bypasses the AMM entirely. It settles USDC from its own reserves to the PoolManager (creating a +amountOut delta that cancels the hook's -amountOut obligation) and mints ERC6909 claims for the incoming dobRWA (creating a -amountIn delta that cancels the +amountIn obligation). Net deltas = zero. The swap completes at exactly 1:1.

delta = toBeforeSwapDelta(+amountIn, -amountOut)
4
Settlement

User receives USDC from hook reserves

The PoolManager adjusts the swapper's deltas (swapDelta - hookDelta), so the user pays dobRWA and receives exactly the same amount in USDC. The hook retains the dobRWA as ERC6909 claims in the PoolManager. No Liquidity Nodes are involved — the USDC comes entirely from the protocol's seeded reserves.


Liquidation Engine

Liquidation Mode

When Dobprotocol flags an asset as distressed, liquidation mode activates. This is the only scenario where Liquidity Node LPs are involved — they provide the USDC and earn discounted dobRWA.

Risk Assessment & Discount

Dobprotocol assesses the risk
Dobprotocol's AI validator agents continuously monitor RWA health. When an asset shows signs of distress, they assess the risk probability and translate it into a discount rate. For example, a 20% risk of value loss becomes penaltyBps = 2000. This discount is applied to the exit price, reflecting the real-world risk of holding that asset.
LPs set their risk appetite
LPs define minPenaltyBps per asset — the minimum discount they require to participate. This is their risk appetite: a higher minimum means the LP only fills when the assessed risk (and therefore the discount) is large enough to justify the exposure.

Normal Mode (1:1 Peg)

Full value swap with zero slippage — no liquidation active

1,000
dobRWA in
1:1 PEG
1,000
USDC out

Liquidation Mode (20% risk assessed by Dobprotocol)

Dobprotocol's validators assessed a 20% risk probability — exit price discounted accordingly

1,000
dobRWA in
-20%
800
USDC out (to seller)
200 dobRWA penalty → permanently locked as ERC6909 (burned from circulation)

LP Fill Mechanics

LPs who set minPenaltyBps ≤ 2000 are eligible to fill this liquidation

LP pays
800 USDC
LP receives
1,000 dobRWA
LP profit
+25%
dobRWA = usdc / (1 - penalty%) — LP buys at discount, earns the spread when peg recovers

Liquidity Nodes

Permissionless LP System

Anyone can become a liquidity provider. Set your own conditions, back specific assets, and earn from liquidation fills.

Phase 1

Register

Deposit USDC to register as an LP. Minimum deposit of 100 USDC required.

MIN_DEPOSIT: 100 USDC
Phase 2

Back Assets

Choose which RWA assets to back. Set your conditions: min oracle price, min penalty, max exposure.

MIN_ALLOCATION: 50 USDC
Phase 3

Get Filled

When liquidations occur, the hook iterates backers in FIFO order. If your conditions match, your USDC is used.

FIFO ordering
Phase 4

Claim Rewards

Claim discounted dobRWA earned from fills. The hook burns ERC6909 claims and transfers the tokens to you.

1.5% protocol fee

LP Condition Parameters

minOraclePrice
Minimum USD oracle price to accept a fill. Reject fills if the asset price drops below your threshold.
minPenaltyBps
Minimum liquidation penalty you require to accept a fill. The penalty itself is set by validators — this is your threshold. Set to 1000 (10%) to only participate when the discount is attractive enough.
maxExposure
Maximum dobRWA you're willing to accumulate for this asset. Caps your risk to a single RWA type.
usdcAllocation
USDC earmarked for this specific asset. Separate from your general available balance.

Withdrawal Rules

Asset Healthy
LP can withdraw 100% of unused allocation with standard 24h timelock. Full flexibility when there's no distress.
Asset Distressed
LP can withdraw 67% immediately (24h timelock). The remaining 33% is held as a reserve that unlocks when the asset returns to healthy — or after a 7-day safety delay.

The reserve ensures liquidity is available when it's needed most. LPs who backed an asset are committed during distress.


Trust Flywheel

From Owner-Backed to Market-Backed

The protocol is designed so that the asset owner bootstraps liquidity early on, and external LPs gradually take over as trust in the system grows.

Bootstrap

Owner Self-Backs

No external trust yet. The asset owner provides USDC as an LP for their own asset. They have the strongest incentive — they know the real state of their asset and can buy back at a discount if it's flagged as distressed.

Like a founder investing in their own company.
Growth

External LPs Enter

The validator builds a track record — accurate prices, correct risk assessments, fair liquidation outcomes. External LPs and AI strategy agents begin providing liquidity based on historical data.

Trust is earned through verifiable on-chain history.
Mature

Market Provides Liquidity

Deep external LP pool. The oracle's reputation is established. The asset owner no longer needs to self-back — the market does it for them. Multiple AI agents compete on accuracy and yield.

The owner's capital is free to deploy elsewhere.

The Trust Flywheel

Accurate Oracle LPs Trust the Discount More Liquidity More Assets Onboard Better Oracle

Every correct risk assessment compounds credibility. Every fair liquidation brings more LP capital.


Security

Safety Rails

Multiple layers of protection against flash-loan attacks, front-running, and excessive liquidation exposure.

Anti-Flash-Loan

LPs must have been backing an asset for a minimum duration before their position is eligible for fills during liquidation events.

MIN_BACKING_AGE: 1 hour
🔒

Withdrawal Timelock

LP USDC withdrawals require a time-delayed request. Prevents LPs from front-running liquidation events by pulling liquidity.

WITHDRAWAL_DELAY: 24 hours
📊

Per-Asset Caps

Each RWA asset has a maximum liquidation cap. Prevents excessive liquidation pressure on any single asset type.

Configured per asset in Registry
🌐

Global Liquidation Cap

A protocol-wide cap limits the total amount of dobRWA that can be liquidated across all assets simultaneously.

globalLiquidationCap in Registry
👥

Backer Limit

Maximum number of LPs per asset prevents unbounded gas costs during on-chain FIFO iteration in liquidation fills.

MAX_BACKERS_PER_ASSET: 50
🕐

Oracle Staleness Check

The vault rejects deposits if the oracle price is stale beyond the configured maximum delay, preventing stale-price exploits.

MAX_ORACLE_DELAY: 1 day
💰

Distress Reserve (33%)

When an LP exits a distressed asset, 33% of their unused allocation is held as a reserve. This ensures liquidity is always available during crisis. The reserve unlocks when the asset returns to healthy or after 7 days.

RESERVE_BPS: 3300 • RESERVE_DELAY: 7 days