
dYdX Agent Gateway
io.github.alekskram由 GitHub 账号 alekskram 发布v0.3.2更新于 Oct 24, 2026
Analytics-only MCP gateway to dYdX v4: auditable trader PnL, funding and OI detectors. No keys.
概览
只读的 MCP 网关,让助手无需 API 密钥即可查询 dYdX v4 行情、交易者盈亏、资金费率与持仓量分析。
- 可以做什么
- 通过 dYdX v4 公共索引器提供 22 个只读工具:行情数据(list_markets、market_detail、candles、recent_trades、historical_funding)、分析(funding_heatmap、market_ta、suggest_stops、cvd、correlation)、交易者查询(trader_profile、trader_pnl_stats、fills_review、raw_fills)、发现(discover_traders、leaderboard、list_traders、registry_stats)、信号(latest_events)以及汇总的 market_digest 简报。它会用充值转账核对交易者权益以识别虚假盈亏,并检测资金费率极值、持仓量异常和清算连锁等模式。
- 适用场景
- 适合助手研究 dYdX v4 市场、在跟单前审查交易者,或监控资金费率、持仓量与清算信号。它仅做分析,不用于下单、签名或管理订单。
- 运行要求
- 作为本地 stdio 进程运行,通常用 uvx dydx-agent-gateway 启动或从 PyPI 安装,需要 Python 3.11 或更高版本,依赖会自动安装。未声明任何 API 密钥、账户或凭据;它读取公共索引器接口,因此需要网络访问。
安装
在 SourceWeft 中
- 打开 控制台中的 dYdX Agent Gateway,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
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.
来源:README.md,提交 eec5527
工具
0版本历史
2- v0.3.2最新Sep 23, 2026
- v0.3.1Sep 22, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分