Skip to main content

What is Atomic Routing?

Atomic Routing is Darex’s implementation of SWIFT-like standardized routing for DeFi - enabling complex multi-step operations (swap → deposit → stake) to execute in a single transaction. Think of it as Amazon’s 1-Click Checkout for DeFi: What used to require multiple transactions, approvals, and manual coordination now happens automatically in one click.

The Problem

Traditional DeFi workflows are complex and error-prone: Traditional Approach (5+ transactions):
  1. Approve USDC to DEX
  2. Swap USDC → EURC on DEX
  3. Wait for swap confirmation
  4. Approve EURC to Aave
  5. Deposit EURC to Aave
Risks:
  • Transaction failures at any step
  • Price changes between steps
  • High gas costs (5 separate transactions)
  • Poor user experience
  • Funds stuck if interrupted

The Solution

Darex enables single-transaction deposits: Darex Approach (1 transaction):
  1. User sends USDC with instrument ID
    • Darex automatically swaps USDC → EURC
    • Darex automatically deposits to Aave
    • User receives aEURC tokens
Benefits:
  • ✅ All steps succeed or fail together (atomic)
  • ✅ No price slippage between steps
  • ✅ 40% lower gas costs
  • ✅ One-click user experience
  • ✅ No partial state or stuck funds

Atomicity Guarantees

Darex ensures all-or-nothing execution:

Success Case

All steps complete successfully:
  • User sends USDC ✅
  • Hook swaps to EURC ✅
  • Hook deposits to Aave ✅
  • User receives aEURC ✅

Failure Case

If ANY step fails, entire transaction reverts:
  • Insufficient liquidity ❌
  • Slippage exceeded ❌
  • Adapter error ❌
  • No partial state changes

What Atomicity Means

Either everything happens or nothing happens. You’ll never be stuck with:
  • EURC when you wanted aEURC
  • Lost tokens in transit
  • Incomplete swaps
  • Failed deposits with successful swaps
No price changes between swap and deposit steps. The rate you see is the rate you get for the entire operation.
If any step fails, the entire transaction reverts automatically. Your original tokens are returned safely to your wallet.
Pay gas only once for the entire operation instead of 5 separate transactions. Average savings: 40%

Transaction Flow Example

Let’s walk through a deposit from USDC to Aave EURC vault:
1

User Initiates

User wants to deposit 1000 USDC into Aave EURC vault (which requires EURC, not USDC)
2

Darex Detects Need

Darex automatically detects that USDC ≠ EURC and a swap is needed
3

Atomic Execution

In a single transaction:
  • Swap USDC → EURC internally
  • Deposit EURC to Aave
  • Mint aEURC to user
4

User Receives

User receives aEURC tokens and starts earning yield immediately

Benefits

Atomicity

All steps succeed or fail together - no partial state

Gas Efficiency

40% gas savings vs manual multi-step approach

User Experience

One-click deposits - no manual coordination

Price Certainty

No price changes between swap and deposit steps

Security

Reentrancy protected, slippage controlled

Composability

Works with any ERC20 token and lending protocol

Comparison with Alternatives

FeatureManual Multi-Tx1inch FusionDarex Atomic Router
Single Transaction
Protocol Agnostic
Gas Optimized⚠️
Automatic Deposits
Slippage ProtectionManual
No Partial State

Withdrawal Flow

Withdrawals work in reverse with the same atomic guarantees:
1

User Initiates Withdrawal

User wants to withdraw from Aave EURC, receive USDC
2

Darex Withdraws

Darex withdraws EURC from Aave using your aEURC tokens
3

Darex Swaps

Darex automatically swaps EURC back to USDC
4

User Receives

User receives original token (USDC) - all in one transaction
Withdrawals have the same atomicity guarantees - if any step fails, the entire transaction reverts and your aEURC tokens remain safe.

Next Steps