How dobdex Works

The complete protocol architecture: from real-world asset tokenization to LP-priced secondary sales, permissionless Liquidity Nodes, shared Pooled LNs, and AI-driven risk management. The oracle prices the asset; Liquidity Nodes price the exit. Seven smart contracts, one unified pipeline.

Ecosystem Architecture Contracts Oracle Swap Flow Liquidation Liquidity Nodes Pooled LN Resale Market 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 dUSDC at oracle price, and sell through Liquidity Nodes who provide exit capital. Sellers pay LP discount + swap fee + protocol fee; LPs earn discounted RWA tokens.

LP-priced exits Liquidation engine Permissionless LPs
dex.dobprotocol.com ↗
Real-world asset  →  ERC-20 token  →  dobRWA  →  USDC

Architecture

Dobdex Contracts

Five 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 RWA tokens

deposit RWA deposit USDC
DobRwaVault

RWA Vault

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

DobPegHook

Uniswap V4 Hook

NoOp custom accounting: routes sells to Liquidity Nodes who price the exit. Bootstrap reserves as fallback.

DobLPRegistry

LP Registry

Permissionless LP system with conditional fills and FIFO ordering

DobPooledLN

Pooled Liquidity Node

Shared USDC vault — co-invest as a single LP position in the registry

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() withdraw() 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 using the NoOp pattern: settles output tokens and mints ERC6909 claims for input tokens, creating zero-net deltas. In production, LP-Only mode is the default — all sells are routed to Liquidity Nodes who provide USDC at a discount they set. LPs earn discounted RWA tokens; sellers pay the discount for instant USDC exit. Hook reserves at 1:1 serve as bootstrap/fallback only. In liquidation mode, Dobprotocol sets a penalty rate and LPs fill at that mandated discount.
_beforeSwap() seedUsdc() releaseRwaTokens() unlockCallback() depositUsdc() withdrawUsdc()
💰
DobLPRegistry.sol
Permissionless LP System
LPs deposit USDC and set per-asset conditions: minimum oracle price, minimum penalty, max exposure, and USDC allocation. LPs participate in two modes: Liquidation fills (queryAndFill) when an asset is distressed at the protocol-mandated penalty rate, and Sell fallback (queryAndFillAtMarket) when the hook lacks USDC for a normal sell — LPs fill at their own discount, no distress required. LPs receive the underlying RWA tokens at a discount, claimable via the vault. Tokens in LP-Only mode skip protocol reserves entirely — sells only succeed if LPs fill them. LPs can also resell claimed RWA tokens at oracle price via the on-chain Resale Market.
register() backAsset() queryAndFill() queryAndFillAtMarket() claimRwaTokens() listRwaForSale() buyListedRwa()
🤝
DobPooledLN.sol
Shared Liquidity Node
Pooled USDC vault that acts as a single LP position in DobLPRegistry. Managed by Dobprotocol, open for anyone to co-invest. Depositors receive shares proportional to their contribution. The operator decides which assets to back and dynamically updates discount rates. When fills happen, RWA tokens are distributed proportionally to all depositors.
deposit() withdraw() updateDiscount() claimRwa() backAsset()

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

LP-Priced Exit

Asset is healthy. User sells dobRWA and receives USDC from Liquidity Nodes who charge a discount (minPenaltyBps) for providing exit capital. Sellers pay this discount for instant USDC; LPs earn discounted RWA tokens. In production, LP-Only mode is the default — all sells go through LPs. Hook reserves at 1:1 serve as bootstrap/fallback only.

Liquidity Nodes: PRIMARY (queryAndFillAtMarket)
Liquidation Mode

Penalty Swap

Asset is distressed. User sells dobRWA at a discount (e.g., -20%). USDC comes from Liquidity Node LPs who earn the underlying RWA tokens at a discount — yield-bearing assets they can hold for dividends.

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 → LP Fill

Hook routes the sell to Liquidity Nodes

The hook bypasses the AMM entirely using the NoOp pattern. In LP-Only mode (the production default), the hook routes the sell to Liquidity Nodes via queryAndFillAtMarket. LPs provide USDC at a discount they set (minPenaltyBps), and receive the seller's RWA tokens at that discounted price. The hook mints ERC6909 claims for the incoming dobRWA and settles the LP-provided USDC to the PoolManager. Net deltas = zero. If LP-Only mode is off, hook reserves can fill at 1:1 as a fallback.

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

Seller receives USDC, LPs receive RWA tokens

The PoolManager adjusts the swapper's deltas (swapDelta - hookDelta), so the seller pays dobRWA and receives USDC minus the LP discount. Liquidity Nodes receive the RWA tokens at the discounted price — yield-bearing assets they can hold for dividends or resell on the RWA Resale Market. The hook retains the dobRWA as ERC6909 claims in the PoolManager.


Liquidation Engine

Liquidation Mode

When Dobprotocol flags an asset as distressed, liquidation mode activates. Liquidity Node LPs provide the USDC and receive the underlying RWA tokens at a discount — yield-bearing assets that pay dividends from the real-world collateral.

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 (LP-Priced Exit)

Seller pays the LP discount for instant USDC — no liquidation active

1,000
dobRWA in
-3% LP
970
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 RWA tokens
LP profit
+25%
RWA amount = dobRWA / oraclePrice — LP buys yield-bearing RWA tokens at a discount, earns dividends from the underlying asset

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 the underlying RWA tokens at a discount. The hook converts your dobRWA allocation to actual yield-bearing RWA tokens via the vault.

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 RWA token value (in dobRWA units) 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.


Pooled LN

Pooled Liquidity Node

A shared vault where anyone deposits USDC to co-invest as a single LP position. Managed by Dobprotocol, powered by the crowd.

How It Works

Shared USDC Vault

The Pooled LN is a DobPooledLN contract that holds USDC from multiple depositors. It registers as a single LP in DobLPRegistry. The operator (Dobprotocol) decides which RWA assets to back and sets the discount rates — depositors simply provide capital and earn proportional returns.

Share-Based

Proportional Distribution

When depositors add USDC they receive shares proportional to their contribution. When LP fills occur and RWA tokens are received, they are distributed proportionally to all shareholders. RWA tokens generate APR via the Token Studio's DistributionPool.

💰

Share-Based Deposits

Deposit USDC, receive shares. Withdraw anytime based on your share of the pool.

📈

Dynamic Discounts

Operator updates discount rates based on on-chain or off-chain data. No depositor action needed.

🌐

Multiple Strategies

Multiple DobPooledLN instances can exist with different risk profiles, asset preferences, and discount strategies.

Pooled LN vs Individual LP

Pooled LN (DobPooledLN)
Deposit USDC and let the operator manage everything. No need to choose assets, set parameters, or monitor conditions. Ideal for passive co-investors.
Individual LP (DobLPRegistry)
Full control. Register directly, choose assets to back, set your own minPenaltyBps, minOraclePrice, and maxExposure. Ideal for sophisticated LPs and AI agents.

Resale Market

RWA Secondary Market

LPs and token holders can list their RWA tokens for sale at oracle price. Buyers pay USDC directly to sellers — no intermediary.

List

listRwaForSale()

Deposit RWA tokens into the hook. Listed at current oracle price. Max 50 sellers per token.

Buy

buyListedRwa()

Pay USDC at oracle price + swap fee. Sellers are filled FIFO. USDC goes directly to sellers.

LP-Only Mode

setLpOnlyMode()

Per-token toggle. When enabled, sells skip protocol reserves — only LPs can fill. Protects dUSDC backing from riskier assets.


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

Emergency Pause

All core contracts (Hook, Vault, LPRegistry, ValidatorRegistry) implement pause/unpause. Admin can halt all operations instantly in case of a security incident.

pause() / unpause()
📈

Oracle Price Bounds

The maxPriceChangeBps parameter limits how much the oracle price can change in a single update, preventing drastic manipulation or erroneous price feeds.

maxPriceChangeBps in Registry
🛡

Slippage Protection

Sellers can encode a minAmountOut in the swap hookData. The hook reverts the transaction if the output falls below the seller's specified minimum.

minAmountOut in hookData
🔑

Admin Transfer

The hook admin role is transferable. Enables secure handoff of protocol governance without redeployment.

transferAdmin()