The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the DYdX Agent Gateway listing page.
One MCP server, 22 read-only tools, and your agent suddenly reads dYdX v4 the way a desk analyst does: live funding, trader PnL it can actually trust, anomaly detectors, leaderboards. No API keys anywhere. The gateway signs nothing, stores nothing, and cannot move funds even if it wanted to.
Copy-trading is where this pays off first. Before you follow anyone, trader_pnl_stats reconciles their equity curve against deposits and transfers; the residual tells you if the numbers are real. We built it after watching a "top trader of the week" who turned out to be down $1,271 all-time with a 77% drawdown.
Funding analytics: a heatmap ranked by |rate| with OI context on every row, realized 1h funding history, and detectors for the patterns that precede pain, like OI spiking while price goes flat, or the |Δprice|↑ + OI↓ cascade signature.
Discovery is on-chain, not scraped: block-scanned trader registry, funded-accounts probe, farmer-bot flags so you copy a trader and not a rewards farmer. One market_digest call gives you the day's events, funding extremes and the leaderboard top in a single response. When you're ready to enter, suggest_stops returns an ATR-based stop, take-profit, breakeven trigger and trailing level for your side.
Full walkthroughs with real outputs: examples/use-cases.md.
Claude Code:
Claude Desktop / Cursor / any mcp.json:
Plain Python:
Hosted (streamable HTTP): dydx-agent-gateway --http --port 8901, then any client:
Requires Python ≥ 3.11. Deps (fastmcp, pycryptodome, ecdsa) install automatically. See examples/ for ready-made configs and a working autonomous agent script.
| Group | Tools |
|---|---|
| Market data | list_markets, market_detail, candles, recent_trades, height, historical_funding |
| Analytics | funding_heatmap, market_ta, suggest_stops, cvd, correlation |
| Traders | trader_profile, trader_pnl_stats, fills_review, raw_fills |
| Discovery | discover_traders, leaderboard, list_traders, registry_stats |
| Signals | latest_events (funding extremes, OI spikes, liquidation cascades, equity jumps) |
| Briefing | market_digest: one call with events + funding + leaderboard top. Start here. |
| Meta | usage_stats: tool-call counters (traction/uptime of your instance) |
Real outputs of every tool: examples/tool-output.md.
Solving real trader problems, five scenarios with live data: examples/use-cases.md.
PnL you can audit. trader_pnl_stats reconciles the identity equity-Δ = Δpnl + ΣnetTransfers on every account; when the residual is not zero, the numbers lie, and the tool says so instead of averaging the lie away. We ran it against real accounts and the residual lands at $0.0000. Deposit-adjusted maxDD, day-winrate and a sharpe-like ratio come out of the same pass.
Detectors instead of dashboards. Funding extremes, OI spikes without price, equity jumps, and the liquidation-cascade signature (|Δprice|↑ + OI↓). Live catches sit in reports/.
The rest is analyst gear: realized funding history, CVD from the trades tape, cross-market correlation with beta, raw fills for execution review, MACD/VWAP/realized-vol enrichments, sortino-like downside risk.
And a habit of writing down what bites. Five indexer gotchas that silently corrupt naive analytics are documented in .agents/skills/dydx-gateway/references/data-gotchas.md; 129 tests (now 133) run in CI on 3.11 and 3.13.
Point an agent at indexer.dydx.trade directly and see how far it gets before the fun starts:
| Raw indexer gives you | You would have to build |
|---|---|
| paginated endpoints (≤1000/req) | per-endpoint pagination logic |
| a funding endpoint that intermittently returns EMPTY or rpc-times out | retry + cached-series fallback |
per-bucket (non-cumulative) netTransfers, newest-first PnL, an unreliable priceChange24H field | reconciliation math; this gateway verifies equity-Δ = Δpnl + ΣnetTransfers per account (phantom-PnL detection) |
| raw candles and trades | detectors (funding extremes, OI spikes, cascade signature), a TA pack (RSI/MACD/ATR/Bollinger/VWAP), CVD, correlation, ATR stop plans |
| address strings in blocks | a validated bech32 trader registry with farmer-bot flags and a verified leaderboard |
The five documented indexer gotchas: .agents/skills/dydx-gateway/references/data-gotchas.md.
Indicators are computed over the current candle window and move with every new bar. nextFundingRate is the exchange's live preview, recomputed continuously; volume24H rolls. Two calls a minute apart will legitimately differ, and that is not a bug.
Every tool is read-only and keyless. The gateway signs nothing and holds no credentials. An offline-tested EIP-712 signer stays in dydx_mcp/signer.py as a library for anyone building their own execution layer; it is wired to no MCP tool.
trader_profile, then trader_pnl_stats, then fills_review. Check the identity residual and the maker/taker mix before anything else.Four sibling read-only MCP gateways, one style: keyless, cached, honest degradation.
| Gateway | Focus |
|---|---|
| dydx-agent-gateway (you are here) | dYdX v4: verified trader PnL, funding/OI anomaly detectors, leaderboard |
| arcus-agent-gateway | 194 tokenized US equities on Robinhood Chain: quotes, holders, whale transfers |
| hyperliquid-agent-gateway | Hyperliquid: 233 perps + spot, funding carry, account risk, HyperEVM |
| aster-agent-gateway | Aster DEX: ~580 futures incl. 24/7 TradFi perps, funding caps/floors |
All four are on glama.ai and PyPI; any of them installs with uvx <name>.
MIT. Not affiliated with dYdX Trading Inc.