DEX · dYdX

dYdX v4 (dYdX Chain) Architecture and Smart Contracts

The history of decentralized finance recalls few steps as radical and technologically bold as the evolution of dYdX. Starting out in 2017 as a set of margin smart contracts on Ethereum L1 (v1/v2) and then migrating to StarkWare's ZK-Rollup (v3), the protocol eventually ran into throughput limits and sequencer centralization.

The answer was dYdX v4 — a complete departure from EVM-compatible smart contracts in favor of its own sovereign Layer-1 network (App-Chain) built on Cosmos SDK and CometBFT consensus. As of 2026, dYdX Chain is the benchmark for decentralized derivatives trading, where matching takes place in validator memory, bypassing the constraints of virtual machines. → More on the dYdX Unlimited ecosystem

Below is the official registry of migration contracts (Ethereum), archival addresses and a technical description of the sovereign network's modules.

For developers: When building trading bots for dYdX v4, you no longer send Web3.js transactions to smart contracts. Instead, you compose protobuf messages (Cosmos transactions) and interact directly with the Indexer API or with validator nodes via gRPC/WebSocket.

dYdX Chain (Sovereign L1 Blockchain) Cosmos SDK
Logic layer (instead of smart contracts):
The dYdX Chain network has no traditional smart contract addresses of the 0x... kind. All complex exchange logic is baked directly into the validators' binary code through custom state modules: x/clob (order book), x/perpetuals (margining) and x/subaccounts. User addresses carry the prefix dydx1.... This architecture eliminates virtual machine overhead (both EVM and CosmWasm), delivering throughput in excess of 2,000 transactions per second.
Liquidity and routing (CCTP & Noble):
In place of vulnerable bridge liquidity pools, dYdX integrated Circle's CCTP (Cross-Chain Transfer Protocol) via the Noble network. Users can seamlessly transfer native USDC from Ethereum or Avalanche directly into dYdX Chain through the decentralized IBC (Inter-Blockchain Communication) protocol. The dollar exists on the network as a pure asset rather than as a wrapped copy carrying depeg risk.
wethDYDX Bridge Contract (Ethereum) — [DISCONTINUED]
0x46b2DeAe6eFf3011008EA27EA36b7c27255ddFA9 Etherscan ↗
Purpose: One-way migration bridge (ethDYDX ➔ dYdX Chain)
It was used to lock ethDYDX tokens on Ethereum in exchange for native DYDX minted by validators on the new network. Following a successful DAO vote, bridge support was officially terminated. Conversion is no longer performed.
Legacy $ethDYDX Token (Ethereum ERC-20)
0x92D6C1e31e14520e676a687f0a93788b716beFf5 Etherscan ↗
Standard: ERC-20 / Solidity 0.7.5 / GovernancePowerDelegationERC20Mixin
Status: Deprecated v3 token. Emission has stopped and all utility functionality has fully moved to dYdX Chain.
Legacy dYdX v3 Perpetual Contract (StarkEx L2)
0xD54f502e184B6B739d7D27a6410a67dc462D69c8 Etherscan ↗
Purpose: The main ZK-Rollup proxy contract on Ethereum (v3). It handled proof processing and verification (STARK Proofs). The system is currently being phased out.

Critical update: End of the ethDYDX migration

An important tokenomics note: the wethDYDX bridge smart contract was definitively retired following a community vote (Governance Vote). Tokens ethDYDX (on Ethereum) can no longer be converted to native DYDX. The ecosystem has fully committed to the sovereign architecture, where the native token is independent and used exclusively within the Cosmos ecosystem for consensus security and fee distribution.

dYdX v4's Perpetual Engine: Architectural Interdependence

Moving to Cosmos SDK allowed dYdX to solve the "DEX trilemma": deliver exceptional throughput, gas-free order placement and full decentralization all at once.

1. In-Memory Orderbook (CLOB) and Off-Chain Matching

In v3, the order book resided on centralized servers of dYdX Trading Inc. In v4, this task was handed to a decentralized network of validators. The developers modified the standard CometBFT mempool: nodes hold the Decentralized Order Book (DLOB) directly in their RAM. When a trader submits a limit order, it is routed across the P2P network without being written to the blockchain and without requiring any gas payment.

The leader node (Proposer) matches orders off-chain before block creation. Only the final results of matched trades (Settlement) enter consensus and are recorded on-chain.

2. MEV Absence and Fair Execution

AMM protocols on Ethereum chronically suffer from MEV (sandwich attacks, front-running). dYdX v4 eradicates the problem at a structural level. Orders are matched before they land in a finalized block. If a validator attempts to insert its own trades (front-run) or manipulate the order flow, the rest of the network detects it immediately. Violating fair-matching rules is punished with severe Slashing — burning the stake of the offending validator.

3. DYDX Tokenomics: Real Yield

In v3, the token served solely as a governance instrument. On dYdX Chain, native DYDX became a full-fledged infrastructure asset. The network uses Proof-of-Stake, where validators and delegators receive 100% of the protocol's trading fees. Since all trading fees are paid in USDC stablecoins, DYDX stakers earn "clean" dollar-denominated yield (Real Yield), whose size depends directly on the exchange's trading volume.

Security Synthesis: dYdX v4 Audit Reports

Building a custom App-Chain introduces consensus and P2P interaction risks that simply do not exist when developing standard ERC-20 contracts. The dYdX v4 codebase has undergone an unprecedented level of scrutiny:

  • Zellic & Trail of Bits: Two authoritative security firms conducted an in-depth audit of the margin engine, cross-collateral logic and liquidation mechanisms (Smart Contract / State Machine logic).
  • Informal Systems: The makers of the Cosmos core stress-tested CometBFT consensus and verified the resilience of the validators' P2P network under extreme load.
  • Halborn: Vulnerability assessment of the Web3 interface infrastructure and API indexers.

To assess the current state of the protocol, review the key dYdX Chain metrics.

Frequently Asked Questions

dYdX v4 is not a smart contract on Ethereum or any other network. It is a sovereign blockchain (Layer 1) built on the Cosmos SDK framework. All trading logic is embedded directly in the binary code of the network's state modules (x/clob, x/perpetuals) rather than in EVM contracts.

ethDYDX (address: 0x92D6C1e31e14520e676a687f0a93788b716beFf5) is a deprecated ERC-20 token on Ethereum. Native DYDX exists only on dYdX Chain and is used for staking (PoS consensus), securing the network and receiving a share of the protocol's trading fees.

No. By decision of decentralized governance (the DAO), support for the wethDYDX migration bridge smart contract has been officially discontinued [1]. Converting ethDYDX into dYdX Chain tokens via the official interface is no longer available.

It is a decentralized order book (Central Limit Order Book, CLOB) in which validator nodes match traders' orders in their own memory (off-chain) instead of through resource-heavy on-chain transactions. This eliminates gas fees for placing orders and delivers speed comparable to centralized exchanges while fully preserving the transparency of on-chain settlement.

---