
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 分