Guide
BrokerMarket dataCrypto API key

dYdX API guide

dYdX moved from Ethereum layer 2 to its own chain in v4, so trading is now a matter of signing chain transactions.

Last verified · Also known as dYdX v4 API, dYdX Chain, dydx-v4-client

Quick answer

dYdX v4 is a decentralized perpetuals exchange running on its own Cosmos-based chain. Market data, positions and fills come from the public Indexer REST and WebSocket APIs with no key; placing orders means signing chain transactions with your wallet, done with the official dydx-v4-client libraries. Use a dedicated wallet and test on the public testnet first.

dYdX API at a glance

Pricing
No API fee; trading fees and gas apply
Availability
Global front-ends exclude the US and other restricted regions
Paper trading
Public testnet
Integration type
Asymmetric / wallet signing
In AlgoGP
Design and backtest in AlgoGP, connect the exported code
Data
Indexer REST + WebSocket, keyless
Orders
Wallet-signed transactions to validators
Clients
dydx-v4-client (Python, TypeScript, Rust)
Testnet
Public testnet with faucet

Reading candles from the Indexer

curl -s "https://indexer.dydx.trade/v4/candles/perpetualMarkets/BTC-USD?resolution=1HOUR&limit=200"
Hourly BTC-USD perpetual candles (keyless).

Build a dYdX strategy with AlgoGP

AlgoGP does not connect to dYdX natively yet. dYdX requires asymmetric or wallet signatures (JWT, RSA-PSS or EIP-712) that the standard-library Python AlgoGP exports cannot produce without an extra library.

  1. 1

    Design and backtest in AlgoGP

    Describe the strategy to the copilot and backtest it on years of normalized history. The result does not depend on any vendor.

  2. 2

    Export the Python project

    Every project exports strategy.py, market_data.py, brokers.py and live.py. The strategy only sees bars, cash, positions and orders, never a vendor’s wire format.

  3. 3

    Plug in dYdX

    Implement the four adapter methods (account, positions, submit_market_order and a candle fetcher) with dYdX’s SDK, or keep a built-in platform for paper trading and add dYdX when you go live.

Built-in brokers for the same markets: Alpaca, Binance, Kraken, Bybit.

dYdX API: frequently asked questions

Do I need an API key for dYdX?

No. Data is public; orders are signed with your wallet’s key.

Can US users trade on dYdX?

The main front-ends block the US and other restricted regions; check the legal terms where you live.

Design and backtest your dYdX strategy first

AlgoGP turns an idea into Python and tests it on years of history before you connect it to dYdX. The exported code keeps the broker behind four small adapter methods.

  • AI copilot writes and revises the rules
  • Backtests with realistic costs
  • Exported Python ready to wire to dYdX

Free plan, no card required.

dYdX alternatives

Independent guide. AlgoGP is not affiliated with dYdX. Limits, prices and availability change; confirm them in the official documentation. Nothing here is investment advice.

Build a strategy