
dYdX Agent Gateway
io.github.alekskramPublished by GitHub account alekskramv0.3.2Updated Oct 24, 2026
Analytics-only MCP gateway to dYdX v4: auditable trader PnL, funding and OI detectors. No keys.
Overview
Read-only MCP gateway that lets an assistant query dYdX v4 market data, trader PnL, funding and open-interest analytics without API keys.
- What you can do
- Exposes 22 read-only tools over the dYdX v4 public indexer: market data (list_markets, market_detail, candles, recent_trades, historical_funding), analytics (funding_heatmap, market_ta, suggest_stops, cvd, correlation), trader inspection (trader_profile, trader_pnl_stats, fills_review, raw_fills), discovery (discover_traders, leaderboard, list_traders, registry_stats), signals (latest_events) and a combined market_digest briefing. It reconciles trader equity against deposits and transfers to flag phantom PnL, and runs detectors for funding extremes, OI spikes and liquidation cascades.
- When to use it
- Useful when an assistant needs to research dYdX v4 markets or vet a trader before copy-trading, or to monitor funding, open interest and liquidation signals. It is analytics only, so it is not for placing, signing or managing orders.
- Requirements
- Runs locally as a stdio process, typically launched with uvx dydx-agent-gateway or installed from PyPI; requires Python 3.11 or newer. Dependencies install automatically. No API keys, accounts or credentials are declared; it reads public indexer endpoints, so network access is needed.
Installation
In SourceWeft
- Open dYdX Agent Gateway in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
dYdX Agent Gateway
[tests] [PyPI] [PyPI downloads] [MCP Catalog] [Python 3.11+] [License: MIT]
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.
Use cases
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.
Install
Claude Code:
Claude Desktop / Cursor / any mcp.json:
Codex (~/.codex/config.toml)
ZCode: register the server and copy the agent skill
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.
Tools (22 — read-only, keyless)
Real outputs of every tool: examples/tool-output.md.
Solving real trader problems, five scenarios with live data: examples/use-cases.md.
What makes it different
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.
Why a gateway and not the raw indexer API?
Point an agent at indexer.dydx.trade directly and see how far it gets before the fun starts:
The five documented indexer gotchas: .agents/skills/dydx-gateway/references/data-gotchas.md.
Data notes
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.
Safety model
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.
FAQ
- Does it trade? No, analytics only. That was the design brief.
- API keys? None. Public indexer endpoints.
- Rate limits? No auth; a 60s markets cache keeps the traffic polite.
- How do I vet a trader before copying?
trader_profile, thentrader_pnl_stats, thenfills_review. Check the identity residual and the maker/taker mix before anything else.
Part of the suite
Four sibling read-only MCP gateways, one style: keyless, cached, honest degradation.
All four are on glama.ai and PyPI; any of them installs with uvx <name>.
License
MIT. Not affiliated with dYdX Trading Inc.
Source: README.md at commit eec5527
Tools
0Version history
2- v0.3.2LatestSep 23, 2026
- v0.3.1Sep 22, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts