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"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
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
Export the Python project
Every project exports
strategy.py,market_data.py,brokers.pyandlive.py. The strategy only sees bars, cash, positions and orders, never a vendor’s wire format. - 3
Plug in dYdX
Implement the four adapter methods (
account,positions,submit_market_orderand 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
- Hyperliquid API GuideOn-chain perpetuals and spot exchange with a REST and WebSocket API; trading actions are signed with a wallet key.
- Deribit API Built into AlgoGP (data)The leading crypto options exchange, with JSON-RPC over HTTP and WebSocket, FIX and a test environment.
- BitMEX API GuideThe original crypto perpetual-swap exchange: a REST and WebSocket API with HMAC signing and a full public testnet.
- OKX API Built into AlgoGPMajor crypto exchange with a V5 REST and WebSocket API for spot, perpetuals, futures and options, plus demo trading.
Frameworks that connect to dYdX
Independent guide. AlgoGP is not affiliated with dYdX. Limits, prices and availability change; confirm them in the official documentation. Nothing here is investment advice.