MCPcopy Index your code
hub / github.com/dydxprotocol/v4-chain

github.com/dydxprotocol/v4-chain @v9.6.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v9.6.2 ↗ · + Follow
25,525 symbols 70,542 edges 3,020 files 5,181 documented · 20% updated 16d agoprotocol/v9.6.3 · 2026-05-14★ 33354 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

dYdX Chain

License

The dYdX v4 software (the ”dYdX Chain”) is a sovereign blockchain software built using Cosmos SDK and CometBFT. It powers a robust decentralized perpetual futures exchange with a high-performance orderbook and matching engine for a feature-rich, self-custodial perpetual trading experience on any market.

This repository contains the source code for the Cosmos SDK application responsible for running the chain and the associated indexer services. The indexer services are a read-only layer that indexes on-chain and off-chain data from a node and serves it to users in a more performant and user-friendly way.

Getting Started

Architecture Overview

Indexer Deep Dive

Front End Deep Dive

Resources and Documentation

Official Documentation

dYdX Academy

dYdX Blog

Clients

v4-clients

Third-party Clients

C++ Client

Python Client

By clicking the above links to third-party clients, you will leave the dYdX Trading Inc. (“dYdX”) GitHub repository and join repositories made available by third parties, which are independent from and unaffiliated with dYdX. dYdX is not responsible for any action taken or content on third-party repositories.

Directory Structure

audits — Audit reports live here.

docs — Home for documentation pertaining to the entire repo.

indexer — Contains source code for indexer services. See its README for developer documentation.

proto — Contains all protocol buffers used by protocol and indexer.

protocol — Contains source code for the Cosmos SDK app that runs the protocol. See its README for developer documentation.

v4-proto-js — Scripts for publishing proto package to npm.

v4-proto-py — Scripts for publishing proto package to PyPI.

Contributing

If you encounter a bug, please file an issue to let us know. Alternatively, please feel free to contribute a bug fix directly. If you are planning to contribute changes that involve significant design choices, please open an issue for discussion instead.

License and Terms

The dYdX Chain is licensed under AGPLv3 and subject to the v4 Terms of Use. The full license can be found here. dYdX does not deploy or run v4 software for public use, or operate or control any dYdX Chain infrastructure. dYdX products and services are not available to persons or entities who reside in, are located in, are incorporated in, or have registered offices in the United States or Canada, or Restricted Persons (as defined in the dYdX Terms of Use).

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Method 14,080
Function 7,367
Interface 1,736
Struct 1,149
Class 935
Enum 181
TypeAlias 60
FuncType 17

Languages

Go74%
TypeScript22%
Rust4%
Python1%

Modules by API surface

protocol/indexer/events/events.pb.go810 symbols
protocol/x/clob/types/query.pb.go568 symbols
protocol/x/clob/types/tx.pb.go472 symbols
protocol/x/vault/types/tx.pb.go344 symbols
protocol/x/vault/types/query.pb.go317 symbols
protocol/x/perpetuals/types/query.pb.go268 symbols
protocol/x/clob/types/order.pb.go268 symbols
protocol/x/bridge/types/query.pb.go245 symbols
protocol/x/feetiers/types/query.pb.go232 symbols
protocol/x/affiliates/types/query.pb.go231 symbols
protocol/x/perpetuals/types/tx.pb.go212 symbols
protocol/x/prices/types/query.pb.go197 symbols

For agents

$ claude mcp add v4-chain \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page