{"at":"2026-11-23T02:36:08.065Z","dir":"sent","era":"server_discover","message":{"id":1,"jsonrpc":"2.0","method":"server/discover","params":{"_meta":{"io.modelcontextprotocol/clientCapabilities":{},"io.modelcontextprotocol/clientInfo":{"name":"didrun-lab","version":"0.1.0"},"io.modelcontextprotocol/protocolVersion":"2026-07-28"}}}}
{"at":"2026-11-23T02:36:09.265Z","dir":"received","era":"server_discover","message":{"id":1,"jsonrpc":"2.0","result":{"_meta":{"io.modelcontextprotocol/serverInfo":{"name":"dydx-agent-gateway","version":"0.3.2"}},"cacheScope":"private","capabilities":{"extensions":{"io.modelcontextprotocol/ui":{}},"logging":{},"prompts":{"listChanged":false},"resources":{"listChanged":false,"subscribe":false},"tools":{"listChanged":false}},"instructions":"Tickers come from list_markets (format 'ETH-USD'); trader addresses from discover_traders/leaderboard. Start with market_digest for a briefing (events + funding extremes + leaderboard). To evaluate a trader: trader_profile then trader_pnl_stats (limit up to 5000 = ~7 months of history). To find traders: discover_traders (funded, on-chain) or list_traders (recent registry addresses). Funding rows carry oi_usd — ignore markets below ~$100k OI as noise. suggest_stops gives an ATR-based risk plan. latest_events returns detector output (funding_extreme / oi_spike_no_price / liq_cascade_signature / equity_jump). Deeper analytics: historical_funding (realized 1h funding history), raw_fills (raw execution tape), cvd (aggressive buy/sell flow), correlation (r + beta between two markets); market_ta adds MACD/VWAP/realized vol and trader_pnl_stats a sortino-like downside ratio.","resultType":"complete","supportedVersions":["2026-07-28"],"ttlMs":0}}}
{"at":"2026-11-23T02:36:09.265Z","dir":"sent","era":"server_discover","message":{"id":2,"jsonrpc":"2.0","method":"tools/list","params":{"_meta":{"io.modelcontextprotocol/clientCapabilities":{},"io.modelcontextprotocol/protocolVersion":"2026-07-28"}}}}
{"at":"2026-11-23T02:36:09.448Z","dir":"received","era":"server_discover","message":{"id":2,"jsonrpc":"2.0","result":{"_meta":{"io.modelcontextprotocol/serverInfo":{"name":"dydx-agent-gateway","version":"0.3.2"}},"cacheScope":"private","resultType":"complete","tools":[{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"openWorldHint":true,"readOnlyHint":true},"description":"All dYdX v4 perpetual markets: oracle price, 24h volume, open interest,\nnext funding rate. Sorted by 24h USD volume by default (or 'oi').\nEach row: ticker, oraclePrice, volume24h_USD, openInterest_USD\n(size x oracle price) and nextFundingRate_pct_1h (pct per hour).\nReturns {\"count_total\", \"count\", \"offset\", \"has_more\", \"next_offset\",\n\"markets\", \"summary\"}; only ACTIVE markets — delisted/settled ones are\nexcluded. Page with offset when has_more is true.\nExample: list_markets(limit=20, sort=\"volume\")","inputSchema":{"additionalProperties":false,"properties":{"limit":{"default":20,"type":"integer"},"offset":{"default":0,"type":"integer"},"sort":{"default":"volume","enum":["volume","oi"],"type":"string"}},"type":"object"},"name":"list_markets","outputSchema":{"additionalProperties":true,"type":"object"},"title":"List Markets"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"openWorldHint":true,"readOnlyHint":true},"description":"One perpetual market in depth: prices, 24h stats computed from candles\n(the raw API priceChange field is unreliable), OI, funding.\nReturns oraclePrice, openInterest, nextFundingRate_pct_1h (pct/hour),\nvolume24h_USD, change24h_pct_from_candles (24h pct change, computed\nfrom 25 x 1h candles), trades24h, basis_pct (mark-vs-oracle deviation\nin pct: (last candle close - oraclePrice) / oraclePrice x 100), and\nthe latest three 1h candles (t/open/close/usdVolume). An unknown or\ndelisted ticker raises an error (MCP isError) — settled markets are\nnot served.\nExample: market_detail(ticker=\"BTC-USD\")","inputSchema":{"additionalProperties":false,"properties":{"ticker":{"type":"string"}},"required":["ticker"],"type":"object"},"name":"market_detail","outputSchema":{"additionalProperties":true,"type":"object"},"title":"Market Detail"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"openWorldHint":true,"readOnlyHint":true},"description":"OHLCV candles with open interest for a market.\nresolution: 1MIN|5MIN|15MIN|30MIN|1HOUR|4HOURS|1DAY.\nEach candle: startedAt, open/high/low/close (price), baseTokenVolume\n(base-coin size), usdVolume (USD), startingOpenInterest. Rows are\nordered oldest -> newest (the\nindexer sends newest-first; we normalize). limit is capped at 1000.\nExample: candles(ticker=\"ETH-USD\", resolution=\"1HOUR\", limit=100)","inputSchema":{"additionalProperties":false,"properties":{"limit":{"default":100,"type":"integer"},"resolution":{"default":"1HOUR","enum":["1MIN","5MIN","15MIN","30MIN","1HOUR","4HOURS","1DAY"],"type":"string"},"ticker":{"type":"string"}},"required":["ticker"],"type":"object"},"name":"candles","title":"Candles"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"openWorldHint":true,"readOnlyHint":true},"description":"Latest public trades of a market (price, side, size, type, time).\nNewest first; limit capped at 100. side is BUY/SELL, size in base coin.\nExample: recent_trades(ticker=\"BTC-USD\", limit=30)","inputSchema":{"additionalProperties":false,"properties":{"limit":{"default":30,"type":"integer"},"ticker":{"type":"string"}},"required":["ticker"],"type":"object"},"name":"recent_trades","title":"Recent Trades"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"openWorldHint":true,"readOnlyHint":true},"description":"Snapshot of any trader's subaccount: equity, open positions, and PnL\ncurve statistics (all-time window from up to 1000 history points).\nReturns equity_now / totalPnl_now / totalPnl_delta_window (USD),\nwindow_start / window_end, and open_positions (market, side, size,\nentry, unrealizedPnl in USD). Pair with trader_pnl_stats for deeper\nstatistics.\nExample: trader_profile(address=\"dydx1m9hg73dtn5ku8ulmj8rjmdqh0hk7uuhawc69cn\")","inputSchema":{"additionalProperties":false,"properties":{"address":{"type":"string"},"subaccount":{"default":0,"type":"integer"}},"required":["address"],"type":"object"},"name":"trader_profile","outputSchema":{"additionalProperties":true,"type":"object"},"title":"Trader Profile"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":true,"readOnlyHint":true},"description":"Current dYdX chain height and time — use for liveness checks.\nReturns {\"height\": current block number, \"time\": block timestamp}.\nExample: height()","inputSchema":{"additionalProperties":false,"properties":{},"type":"object"},"name":"height","outputSchema":{"additionalProperties":true,"type":"object"},"title":"Height"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"openWorldHint":true,"readOnlyHint":true},"description":"All markets ranked by |next funding rate| (1h, annualized). Shows which\nsides pay: positive = longs pay shorts. Rows carry OI so agents can\nignore micro-markets; raise min_oi_usd to filter noise.\nEach row: ticker, funding_pct_1h (pct per hour), funding_pct_annualized\n(1h rate x 24 x 365), oi_usd, oraclePrice, and exactly one of\nlongs_pay / shorts_pay = True. Zero-rate markets and markets below\nmin_oi_usd are skipped. Returns {\"count_nonzero\", \"top\", \"summary\",\n\"offset\", \"has_more\"} — page with offset when has_more is true.\nExample: funding_heatmap(limit=15, min_oi_usd=100000.0)","inputSchema":{"additionalProperties":false,"properties":{"limit":{"default":15,"type":"integer"},"min_oi_usd":{"default":10000.0,"type":"number"},"offset":{"default":0,"type":"integer"}},"type":"object"},"name":"funding_heatmap","outputSchema":{"additionalProperties":true,"type":"object"},"title":"Funding Heatmap"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"openWorldHint":true,"readOnlyHint":true},"description":"Technical snapshot computed from dYdX candles: RSI(14), EMA20/EMA50\ntrend, ATR(14) volatility, Bollinger(20,2) position, MACD(12,26,9),\nVWAP(20) and annualized realized vol. Pure local math — no external\nTA library.\nKey fields: price, trend_ema20_50 (\"up\"/\"down\"), rsi14 (0-100) and\nrsi_zone (overbought >70 / oversold <30 / neutral), atr14 (absolute)\nand atr_pct_of_price (pct), bollinger_pctB (0 = lower band, 1 = upper\nband), macd_line/signal_line/macd_hist (classic 12/26/9; hist > 0 =\nbullish momentum), vwap_20 (volume-weighted average price over the\nlast 20 candles: typical price (H+L+C)/3 weighted by usdVolume) and\nrealized_vol_annualized_pct (population std of log returns x\nsqrt(candles-per-year), scaled by resolution). Needs >=55 candles;\nreturns {\"error\": ...} for thin markets.\nExample: market_ta(ticker=\"BTC-USD\", resolution=\"1HOUR\")","inputSchema":{"additionalProperties":false,"properties":{"resolution":{"default":"1HOUR","type":"string"},"ticker":{"type":"string"}},"required":["ticker"],"type":"object"},"name":"market_ta","outputSchema":{"additionalProperties":true,"type":"object"},"title":"Market Ta"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"openWorldHint":true,"readOnlyHint":true},"description":"ATR-based risk plan: stop-loss, take-profit, breakeven trigger and\ntrailing level for a long/short entry. Agent-managed position helper.\nUnknown ticker (no oracle price) raises an error (MCP isError);\nreturns {\"error\": ...} when no ATR is available (thin market).\nAll output prices are in market price units: stop_loss / take_profit\nsit atr_mult_sl / atr_mult_tp x ATR(14) from entry (entry defaults to\nthe current oracle price); breakeven_after is the price at +1 ATR in\nprofit (then move SL to entry and trail by 1 ATR); risk_reward =\nTP distance / SL distance.\nExample: suggest_stops(ticker=\"BTC-USD\", side=\"LONG\", atr_mult_sl=1.5)","inputSchema":{"additionalProperties":false,"properties":{"atr_mult_sl":{"default":1.5,"type":"number"},"atr_mult_tp":{"default":2.5,"type":"number"},"entry":{"anyOf":[{"type":"number"},{"type":"null"}],"default":null},"resolution":{"default":"1HOUR","type":"string"},"side":{"type":"string"},"ticker":{"type":"string"}},"required":["ticker","side"],"type":"object"},"name":"suggest_stops","outputSchema":{"additionalProperties":true,"type":"object"},"title":"Suggest Stops"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"openWorldHint":true,"readOnlyHint":true},"description":"Execution review from the latest fills: maker/taker split, per-market\ndistribution, traded volume, avg fill size. (Per-fill PnL is not exposed\nby the indexer; use trader_pnl_stats for win-rate.)\nKey fields: fills_sampled (count), maker_share_pct (0-100),\nsampled_volume_USD, avg_fill_USD, top_markets (top 5 by fill count).\nReturns {\"summary\": \"no fills\"} for accounts with no fills.\nExample: fills_review(address=\"dydx1m9hg73dtn5ku8ulmj8rjmdqh0hk7uuhawc69cn\")","inputSchema":{"additionalProperties":false,"properties":{"address":{"type":"string"},"limit":{"default":100,"type":"integer"},"subaccount":{"default":0,"type":"integer"}},"required":["address"],"type":"object"},"name":"fills_review","outputSchema":{"additionalProperties":true,"type":"object"},"title":"Fills Review"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"openWorldHint":true,"readOnlyHint":true},"description":"Raw 1h funding rate history of a market (as realized, not the\nnext-rate preview in market_detail): each point is the rate actually\npaid that hour; annualized_pct = rate x 24 x 365 for scale. Default\n168 points = 7 days. Points are ordered oldest -> newest (candles\nconvention); limit capped at 500.\nPositive = longs paid shorts. An unknown or delisted ticker raises an\nerror (MCP isError) — call list_markets for the valid set (format:\n'ETH-USD').\nExample: historical_funding(ticker=\"ETH-USD\", limit=168)","inputSchema":{"additionalProperties":false,"properties":{"limit":{"default":168,"type":"integer"},"ticker":{"type":"string"}},"required":["ticker"],"type":"object"},"name":"historical_funding","outputSchema":{"additionalProperties":true,"type":"object"},"title":"Historical Funding"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"openWorldHint":true,"readOnlyHint":true},"description":"Raw execution tape for a subaccount — every field the indexer\ngives, unchanged — for agents doing their own execution-quality\nmath (the aggregated view lives in fills_review). Each fill: t\n(createdAt), market, side, liquidity (MAKER/TAKER), type, price,\nsize (base coin), usd_notional (price x size), fee, and the\nposition context (positionSideBefore / positionSizeBefore /\nentryPriceBefore). Newest first; limit capped at 1000. Addresses\ncome from discover_traders / leaderboard / list_traders.\nExample: raw_fills(address=\"dydx1m9hg73dtn5ku8ulmj8rjmdqh0hk7uuhawc69cn\")","inputSchema":{"additionalProperties":false,"properties":{"address":{"type":"string"},"limit":{"default":200,"type":"integer"},"subaccount":{"default":0,"type":"integer"}},"required":["address"],"type":"object"},"name":"raw_fills","outputSchema":{"additionalProperties":true,"type":"object"},"title":"Raw Fills"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"openWorldHint":true,"readOnlyHint":true},"description":"Cumulative Volume Delta from the latest public trades: running\nsum of +size on BUY / -size on SELL, oldest -> newest within the\nsample. Rising CVD = aggressive buying dominating. Volumes are in\nthe base coin. Returns cvd_final (net aggressive flow),\nbuy_volume / sell_volume, trade window bounds (t_first / t_last),\ntrades_sampled and cvd_series_last (the last 50 running values —\nfull series stays out of the response to keep it compact).\nAn unknown or delisted ticker raises an error (MCP isError) — call\nlist_markets for the valid set (format: 'ETH-USD').\nExample: cvd(ticker=\"BTC-USD\", trades_limit=500)","inputSchema":{"additionalProperties":false,"properties":{"ticker":{"type":"string"},"trades_limit":{"default":500,"type":"integer"}},"required":["ticker"],"type":"object"},"name":"cvd","outputSchema":{"additionalProperties":true,"type":"object"},"title":"Cvd"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"openWorldHint":true,"readOnlyHint":true},"description":"Pearson correlation of two markets' log returns over candles:\nr in [-1, 1] plus beta(a|b) — the sensitivity of a to b (a moves\nbeta x b's move, both in log space). Candle series are JOINED by\nstartedAt (only candles with the same timestamp on both sides are\ncompared), so partially-overlapping histories pair correctly.\nBoth tickers are validated; call list_markets for the valid set\n(format: 'ETH-USD'). Returns {\"error\": ...} when there is\ninsufficient or constant data.\nExample: correlation(ticker_a=\"BTC-USD\", ticker_b=\"ETH-USD\")","inputSchema":{"additionalProperties":false,"properties":{"limit":{"default":168,"type":"integer"},"resolution":{"default":"1HOUR","type":"string"},"ticker_a":{"type":"string"},"ticker_b":{"type":"string"}},"required":["ticker_a","ticker_b"],"type":"object"},"name":"correlation","outputSchema":{"additionalProperties":true,"type":"object"},"title":"Correlation"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"openWorldHint":true,"readOnlyHint":true},"description":"Deep PnL statistics from the equity curve: daily PnL, day-winrate,\nmax drawdown (deposit-adjusted), Sharpe-like daily ratio, and the\ndata-accuracy reconciliation residual (phantom-PnL detector).\nNOTE: pass limit as keyword: trader_pnl_stats(addr, limit=500),\nNOT positionally (second positional arg is subaccountNumber).\nKey fields: day_winrate_pct (0-100), max_drawdown_pct (pct, net of\n    deposits/withdrawals) with max_drawdown_usd (same drawdown in USD)\n    and dd_pct_unreliable (true when the deposit-adjusted peak at the\n    worst drawdown was near zero — trust the USD figure then),\n    avg_daily_pnl / best_day / worst_day (USD per\nUTC day), sharpe_like_daily, identity_max_residual_usd (expect < $1\non clean data). limit: history depth in points — 1000 ≈ 42 days\n(default, fast), 5000 ≈ 7 months (slower, multi-page fetch).\nExample: trader_pnl_stats(address=\"dydx1m9hg73dtn5ku8ulmj8rjmdqh0hk7uuhawc69cn\", limit=5000)","inputSchema":{"additionalProperties":false,"properties":{"address":{"type":"string"},"limit":{"default":1000,"type":"integer"},"subaccount":{"default":0,"type":"integer"}},"required":["address"],"type":"object"},"name":"trader_pnl_stats","outputSchema":{"additionalProperties":true,"type":"object"},"title":"Trader Pnl Stats"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"Live stats of our on-chain address registry (block scanner):\nhow many active addresses collected, scan height, freshness.\nReturns addresses_total, scanned_up_to_height (last ingested dYdX\nblock), seen_last_24h (addresses seen in the last 24h) and the sqlite\npath. On hosts where the optional scanner has not run, returns a\nnote instead — market/trader tools still work via the public indexer.\nExample: registry_stats()","inputSchema":{"additionalProperties":false,"properties":{},"type":"object"},"name":"registry_stats","outputSchema":{"additionalProperties":true,"type":"object"},"title":"Registry Stats"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"openWorldHint":true,"readOnlyHint":true},"description":"Recently active trader addresses from the block-scanner registry\n(high-frequency validator committers filtered out by max_hits).\nEach row: address, hits (chain appearances), first_seen / last_seen,\nlast_height. Returns {\"total\", \"count\", \"offset\", \"has_more\",\n\"next_offset\", \"traders\"}; traders == [] when the registry is not\nbuilt on this host. Page with offset when has_more is true.\nFeed an address into trader_profile / trader_pnl_stats next.\nExample: list_traders(limit=10, max_hits=100)","inputSchema":{"additionalProperties":false,"properties":{"limit":{"default":10,"type":"integer"},"max_hits":{"default":100,"type":"integer"},"offset":{"default":0,"type":"integer"}},"type":"object"},"name":"list_traders","outputSchema":{"additionalProperties":true,"type":"object"},"title":"List Traders"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"openWorldHint":true,"readOnlyHint":true},"description":"Screener: funded, recently active traders discovered from the chain —\nregistry candidates probed for live equity. Start here, then analyze\neach with trader_profile. Each row: address, equity (USD, >=\nmin_equity), registry_hits, last_seen.\nExample: discover_traders(limit=5, min_equity=100.0)","inputSchema":{"additionalProperties":false,"properties":{"limit":{"default":5,"type":"integer"},"min_equity":{"default":100.0,"type":"number"}},"type":"object"},"name":"discover_traders","outputSchema":{"properties":{"result":{"items":{"additionalProperties":true,"type":"object"},"type":"array"}},"required":["result"],"type":"object","x-fastmcp-wrap-result":true},"title":"Discover Traders"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"openWorldHint":true,"readOnlyHint":true},"description":"Verified trader leaderboard from our registry + PnL engine\n(batch-computed). metric: pnl_window | pnl_total | equity | day_winrate.\nFarmer flags mark likely rewards-farming bots (heuristic v0).\nEach row (USD where monetary): address, equity, pnl_total, pnl_window,\nday_winrate (pct 0-100), max_dd (pct), maker_share, avg_fill,\nfarmer_flag (bool), identity_residual. Requires a batch run — otherwise\nreturns {\"error\": \"no leaderboard run yet — run leaderboard.py first\"}.\nExample: leaderboard(limit=20, metric=\"pnl_window\")","inputSchema":{"additionalProperties":false,"properties":{"limit":{"default":20,"type":"integer"},"metric":{"default":"pnl_window","enum":["pnl_window","pnl_total","equity","day_winrate"],"type":"string"},"offset":{"default":0,"type":"integer"}},"type":"object"},"name":"leaderboard","outputSchema":{"additionalProperties":true,"type":"object"},"title":"Leaderboard"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"Latest anomaly events from our detectors: funding_extreme,\noi_spike_no_price, equity_jump, liq_cascade_signature. Each row: ts,\nkind, subject (ticker or address) and payload (dict of detector\nnumbers). Optional kind filter; offset pages past the newest slice\n(events are pruned at 5000 — offset+limit beyond that returns []).\nSubscribe via webhooks/Telegram (alerts).\nExample: latest_events(limit=20, kind=\"funding_extreme\")","inputSchema":{"additionalProperties":false,"properties":{"kind":{"anyOf":[{"enum":["funding_extreme","oi_spike_no_price","equity_jump","liq_cascade_signature"],"type":"string"},{"type":"null"}],"default":null},"limit":{"default":20,"type":"integer"},"offset":{"default":0,"type":"integer"}},"type":"object"},"name":"latest_events","outputSchema":{"properties":{"result":{"items":{"additionalProperties":true,"type":"object"},"type":"array"}},"required":["result"],"type":"object","x-fastmcp-wrap-result":true},"title":"Latest Events"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"One-call market briefing: latest detector events + funding extremes\n(liquid markets only) + verified leaderboard top. The daily briefing\nan agent (or human) needs before anything else.\nReturns: events (up to 5, payload flattened into each row), funding\n(top-5 funding rows, markets with >= $100k OI) and leaderboard_top\n(top-3 by pnl_window: address, pnl_window, equity, day_winrate).\nExample: market_digest()","inputSchema":{"additionalProperties":false,"properties":{},"type":"object"},"name":"market_digest","outputSchema":{"additionalProperties":true,"type":"object"},"title":"Market Digest"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"Tool-call counters since deployment (traction/uptime metrics).\nReturns calls_total, calls_24h, calls_7d and top_tools (top-5\n(tool, count) pairs) recorded by this gateway instance.\nExample: usage_stats()","inputSchema":{"additionalProperties":false,"properties":{},"type":"object"},"name":"usage_stats","outputSchema":{"additionalProperties":true,"type":"object"},"title":"Usage Stats"}],"ttlMs":0}}}
{"at":"2026-11-23T02:36:09.599Z","dir":"sent","era":"initialize","message":{"id":1,"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{},"clientInfo":{"name":"didrun-lab","version":"0.1.0"},"protocolVersion":"2025-11-25"}}}
{"at":"2026-11-23T02:36:10.845Z","dir":"received","era":"initialize","message":{"id":1,"jsonrpc":"2.0","result":{"capabilities":{"logging":{},"prompts":{"listChanged":true},"resources":{"listChanged":true,"subscribe":false},"tools":{"listChanged":true}},"instructions":"Tickers come from list_markets (format 'ETH-USD'); trader addresses from discover_traders/leaderboard. Start with market_digest for a briefing (events + funding extremes + leaderboard). To evaluate a trader: trader_profile then trader_pnl_stats (limit up to 5000 = ~7 months of history). To find traders: discover_traders (funded, on-chain) or list_traders (recent registry addresses). Funding rows carry oi_usd — ignore markets below ~$100k OI as noise. suggest_stops gives an ATR-based risk plan. latest_events returns detector output (funding_extreme / oi_spike_no_price / liq_cascade_signature / equity_jump). Deeper analytics: historical_funding (realized 1h funding history), raw_fills (raw execution tape), cvd (aggressive buy/sell flow), correlation (r + beta between two markets); market_ta adds MACD/VWAP/realized vol and trader_pnl_stats a sortino-like downside ratio.","protocolVersion":"2025-11-25","serverInfo":{"name":"dydx-agent-gateway","version":"0.3.2"}}}}
{"at":"2026-11-23T02:36:10.845Z","dir":"sent","era":"initialize","message":{"jsonrpc":"2.0","method":"notifications/initialized"}}
{"at":"2026-11-23T02:36:10.845Z","dir":"sent","era":"initialize","message":{"id":2,"jsonrpc":"2.0","method":"tools/list","params":{}}}
{"at":"2026-11-23T02:36:11.026Z","dir":"received","era":"initialize","message":{"id":2,"jsonrpc":"2.0","result":{"tools":[{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"openWorldHint":true,"readOnlyHint":true},"description":"All dYdX v4 perpetual markets: oracle price, 24h volume, open interest,\nnext funding rate. Sorted by 24h USD volume by default (or 'oi').\nEach row: ticker, oraclePrice, volume24h_USD, openInterest_USD\n(size x oracle price) and nextFundingRate_pct_1h (pct per hour).\nReturns {\"count_total\", \"count\", \"offset\", \"has_more\", \"next_offset\",\n\"markets\", \"summary\"}; only ACTIVE markets — delisted/settled ones are\nexcluded. Page with offset when has_more is true.\nExample: list_markets(limit=20, sort=\"volume\")","inputSchema":{"additionalProperties":false,"properties":{"limit":{"default":20,"type":"integer"},"offset":{"default":0,"type":"integer"},"sort":{"default":"volume","enum":["volume","oi"],"type":"string"}},"type":"object"},"name":"list_markets","outputSchema":{"additionalProperties":true,"type":"object"},"title":"List Markets"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"openWorldHint":true,"readOnlyHint":true},"description":"One perpetual market in depth: prices, 24h stats computed from candles\n(the raw API priceChange field is unreliable), OI, funding.\nReturns oraclePrice, openInterest, nextFundingRate_pct_1h (pct/hour),\nvolume24h_USD, change24h_pct_from_candles (24h pct change, computed\nfrom 25 x 1h candles), trades24h, basis_pct (mark-vs-oracle deviation\nin pct: (last candle close - oraclePrice) / oraclePrice x 100), and\nthe latest three 1h candles (t/open/close/usdVolume). An unknown or\ndelisted ticker raises an error (MCP isError) — settled markets are\nnot served.\nExample: market_detail(ticker=\"BTC-USD\")","inputSchema":{"additionalProperties":false,"properties":{"ticker":{"type":"string"}},"required":["ticker"],"type":"object"},"name":"market_detail","outputSchema":{"additionalProperties":true,"type":"object"},"title":"Market Detail"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"openWorldHint":true,"readOnlyHint":true},"description":"OHLCV candles with open interest for a market.\nresolution: 1MIN|5MIN|15MIN|30MIN|1HOUR|4HOURS|1DAY.\nEach candle: startedAt, open/high/low/close (price), baseTokenVolume\n(base-coin size), usdVolume (USD), startingOpenInterest. Rows are\nordered oldest -> newest (the\nindexer sends newest-first; we normalize). limit is capped at 1000.\nExample: candles(ticker=\"ETH-USD\", resolution=\"1HOUR\", limit=100)","inputSchema":{"additionalProperties":false,"properties":{"limit":{"default":100,"type":"integer"},"resolution":{"default":"1HOUR","enum":["1MIN","5MIN","15MIN","30MIN","1HOUR","4HOURS","1DAY"],"type":"string"},"ticker":{"type":"string"}},"required":["ticker"],"type":"object"},"name":"candles","title":"Candles"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"openWorldHint":true,"readOnlyHint":true},"description":"Latest public trades of a market (price, side, size, type, time).\nNewest first; limit capped at 100. side is BUY/SELL, size in base coin.\nExample: recent_trades(ticker=\"BTC-USD\", limit=30)","inputSchema":{"additionalProperties":false,"properties":{"limit":{"default":30,"type":"integer"},"ticker":{"type":"string"}},"required":["ticker"],"type":"object"},"name":"recent_trades","title":"Recent Trades"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"openWorldHint":true,"readOnlyHint":true},"description":"Snapshot of any trader's subaccount: equity, open positions, and PnL\ncurve statistics (all-time window from up to 1000 history points).\nReturns equity_now / totalPnl_now / totalPnl_delta_window (USD),\nwindow_start / window_end, and open_positions (market, side, size,\nentry, unrealizedPnl in USD). Pair with trader_pnl_stats for deeper\nstatistics.\nExample: trader_profile(address=\"dydx1m9hg73dtn5ku8ulmj8rjmdqh0hk7uuhawc69cn\")","inputSchema":{"additionalProperties":false,"properties":{"address":{"type":"string"},"subaccount":{"default":0,"type":"integer"}},"required":["address"],"type":"object"},"name":"trader_profile","outputSchema":{"additionalProperties":true,"type":"object"},"title":"Trader Profile"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":true,"readOnlyHint":true},"description":"Current dYdX chain height and time — use for liveness checks.\nReturns {\"height\": current block number, \"time\": block timestamp}.\nExample: height()","inputSchema":{"additionalProperties":false,"properties":{},"type":"object"},"name":"height","outputSchema":{"additionalProperties":true,"type":"object"},"title":"Height"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"openWorldHint":true,"readOnlyHint":true},"description":"All markets ranked by |next funding rate| (1h, annualized). Shows which\nsides pay: positive = longs pay shorts. Rows carry OI so agents can\nignore micro-markets; raise min_oi_usd to filter noise.\nEach row: ticker, funding_pct_1h (pct per hour), funding_pct_annualized\n(1h rate x 24 x 365), oi_usd, oraclePrice, and exactly one of\nlongs_pay / shorts_pay = True. Zero-rate markets and markets below\nmin_oi_usd are skipped. Returns {\"count_nonzero\", \"top\", \"summary\",\n\"offset\", \"has_more\"} — page with offset when has_more is true.\nExample: funding_heatmap(limit=15, min_oi_usd=100000.0)","inputSchema":{"additionalProperties":false,"properties":{"limit":{"default":15,"type":"integer"},"min_oi_usd":{"default":10000.0,"type":"number"},"offset":{"default":0,"type":"integer"}},"type":"object"},"name":"funding_heatmap","outputSchema":{"additionalProperties":true,"type":"object"},"title":"Funding Heatmap"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"openWorldHint":true,"readOnlyHint":true},"description":"Technical snapshot computed from dYdX candles: RSI(14), EMA20/EMA50\ntrend, ATR(14) volatility, Bollinger(20,2) position, MACD(12,26,9),\nVWAP(20) and annualized realized vol. Pure local math — no external\nTA library.\nKey fields: price, trend_ema20_50 (\"up\"/\"down\"), rsi14 (0-100) and\nrsi_zone (overbought >70 / oversold <30 / neutral), atr14 (absolute)\nand atr_pct_of_price (pct), bollinger_pctB (0 = lower band, 1 = upper\nband), macd_line/signal_line/macd_hist (classic 12/26/9; hist > 0 =\nbullish momentum), vwap_20 (volume-weighted average price over the\nlast 20 candles: typical price (H+L+C)/3 weighted by usdVolume) and\nrealized_vol_annualized_pct (population std of log returns x\nsqrt(candles-per-year), scaled by resolution). Needs >=55 candles;\nreturns {\"error\": ...} for thin markets.\nExample: market_ta(ticker=\"BTC-USD\", resolution=\"1HOUR\")","inputSchema":{"additionalProperties":false,"properties":{"resolution":{"default":"1HOUR","type":"string"},"ticker":{"type":"string"}},"required":["ticker"],"type":"object"},"name":"market_ta","outputSchema":{"additionalProperties":true,"type":"object"},"title":"Market Ta"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"openWorldHint":true,"readOnlyHint":true},"description":"ATR-based risk plan: stop-loss, take-profit, breakeven trigger and\ntrailing level for a long/short entry. Agent-managed position helper.\nUnknown ticker (no oracle price) raises an error (MCP isError);\nreturns {\"error\": ...} when no ATR is available (thin market).\nAll output prices are in market price units: stop_loss / take_profit\nsit atr_mult_sl / atr_mult_tp x ATR(14) from entry (entry defaults to\nthe current oracle price); breakeven_after is the price at +1 ATR in\nprofit (then move SL to entry and trail by 1 ATR); risk_reward =\nTP distance / SL distance.\nExample: suggest_stops(ticker=\"BTC-USD\", side=\"LONG\", atr_mult_sl=1.5)","inputSchema":{"additionalProperties":false,"properties":{"atr_mult_sl":{"default":1.5,"type":"number"},"atr_mult_tp":{"default":2.5,"type":"number"},"entry":{"anyOf":[{"type":"number"},{"type":"null"}],"default":null},"resolution":{"default":"1HOUR","type":"string"},"side":{"type":"string"},"ticker":{"type":"string"}},"required":["ticker","side"],"type":"object"},"name":"suggest_stops","outputSchema":{"additionalProperties":true,"type":"object"},"title":"Suggest Stops"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"openWorldHint":true,"readOnlyHint":true},"description":"Execution review from the latest fills: maker/taker split, per-market\ndistribution, traded volume, avg fill size. (Per-fill PnL is not exposed\nby the indexer; use trader_pnl_stats for win-rate.)\nKey fields: fills_sampled (count), maker_share_pct (0-100),\nsampled_volume_USD, avg_fill_USD, top_markets (top 5 by fill count).\nReturns {\"summary\": \"no fills\"} for accounts with no fills.\nExample: fills_review(address=\"dydx1m9hg73dtn5ku8ulmj8rjmdqh0hk7uuhawc69cn\")","inputSchema":{"additionalProperties":false,"properties":{"address":{"type":"string"},"limit":{"default":100,"type":"integer"},"subaccount":{"default":0,"type":"integer"}},"required":["address"],"type":"object"},"name":"fills_review","outputSchema":{"additionalProperties":true,"type":"object"},"title":"Fills Review"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"openWorldHint":true,"readOnlyHint":true},"description":"Raw 1h funding rate history of a market (as realized, not the\nnext-rate preview in market_detail): each point is the rate actually\npaid that hour; annualized_pct = rate x 24 x 365 for scale. Default\n168 points = 7 days. Points are ordered oldest -> newest (candles\nconvention); limit capped at 500.\nPositive = longs paid shorts. An unknown or delisted ticker raises an\nerror (MCP isError) — call list_markets for the valid set (format:\n'ETH-USD').\nExample: historical_funding(ticker=\"ETH-USD\", limit=168)","inputSchema":{"additionalProperties":false,"properties":{"limit":{"default":168,"type":"integer"},"ticker":{"type":"string"}},"required":["ticker"],"type":"object"},"name":"historical_funding","outputSchema":{"additionalProperties":true,"type":"object"},"title":"Historical Funding"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"openWorldHint":true,"readOnlyHint":true},"description":"Raw execution tape for a subaccount — every field the indexer\ngives, unchanged — for agents doing their own execution-quality\nmath (the aggregated view lives in fills_review). Each fill: t\n(createdAt), market, side, liquidity (MAKER/TAKER), type, price,\nsize (base coin), usd_notional (price x size), fee, and the\nposition context (positionSideBefore / positionSizeBefore /\nentryPriceBefore). Newest first; limit capped at 1000. Addresses\ncome from discover_traders / leaderboard / list_traders.\nExample: raw_fills(address=\"dydx1m9hg73dtn5ku8ulmj8rjmdqh0hk7uuhawc69cn\")","inputSchema":{"additionalProperties":false,"properties":{"address":{"type":"string"},"limit":{"default":200,"type":"integer"},"subaccount":{"default":0,"type":"integer"}},"required":["address"],"type":"object"},"name":"raw_fills","outputSchema":{"additionalProperties":true,"type":"object"},"title":"Raw Fills"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"openWorldHint":true,"readOnlyHint":true},"description":"Cumulative Volume Delta from the latest public trades: running\nsum of +size on BUY / -size on SELL, oldest -> newest within the\nsample. Rising CVD = aggressive buying dominating. Volumes are in\nthe base coin. Returns cvd_final (net aggressive flow),\nbuy_volume / sell_volume, trade window bounds (t_first / t_last),\ntrades_sampled and cvd_series_last (the last 50 running values —\nfull series stays out of the response to keep it compact).\nAn unknown or delisted ticker raises an error (MCP isError) — call\nlist_markets for the valid set (format: 'ETH-USD').\nExample: cvd(ticker=\"BTC-USD\", trades_limit=500)","inputSchema":{"additionalProperties":false,"properties":{"ticker":{"type":"string"},"trades_limit":{"default":500,"type":"integer"}},"required":["ticker"],"type":"object"},"name":"cvd","outputSchema":{"additionalProperties":true,"type":"object"},"title":"Cvd"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"openWorldHint":true,"readOnlyHint":true},"description":"Pearson correlation of two markets' log returns over candles:\nr in [-1, 1] plus beta(a|b) — the sensitivity of a to b (a moves\nbeta x b's move, both in log space). Candle series are JOINED by\nstartedAt (only candles with the same timestamp on both sides are\ncompared), so partially-overlapping histories pair correctly.\nBoth tickers are validated; call list_markets for the valid set\n(format: 'ETH-USD'). Returns {\"error\": ...} when there is\ninsufficient or constant data.\nExample: correlation(ticker_a=\"BTC-USD\", ticker_b=\"ETH-USD\")","inputSchema":{"additionalProperties":false,"properties":{"limit":{"default":168,"type":"integer"},"resolution":{"default":"1HOUR","type":"string"},"ticker_a":{"type":"string"},"ticker_b":{"type":"string"}},"required":["ticker_a","ticker_b"],"type":"object"},"name":"correlation","outputSchema":{"additionalProperties":true,"type":"object"},"title":"Correlation"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"openWorldHint":true,"readOnlyHint":true},"description":"Deep PnL statistics from the equity curve: daily PnL, day-winrate,\nmax drawdown (deposit-adjusted), Sharpe-like daily ratio, and the\ndata-accuracy reconciliation residual (phantom-PnL detector).\nNOTE: pass limit as keyword: trader_pnl_stats(addr, limit=500),\nNOT positionally (second positional arg is subaccountNumber).\nKey fields: day_winrate_pct (0-100), max_drawdown_pct (pct, net of\n    deposits/withdrawals) with max_drawdown_usd (same drawdown in USD)\n    and dd_pct_unreliable (true when the deposit-adjusted peak at the\n    worst drawdown was near zero — trust the USD figure then),\n    avg_daily_pnl / best_day / worst_day (USD per\nUTC day), sharpe_like_daily, identity_max_residual_usd (expect < $1\non clean data). limit: history depth in points — 1000 ≈ 42 days\n(default, fast), 5000 ≈ 7 months (slower, multi-page fetch).\nExample: trader_pnl_stats(address=\"dydx1m9hg73dtn5ku8ulmj8rjmdqh0hk7uuhawc69cn\", limit=5000)","inputSchema":{"additionalProperties":false,"properties":{"address":{"type":"string"},"limit":{"default":1000,"type":"integer"},"subaccount":{"default":0,"type":"integer"}},"required":["address"],"type":"object"},"name":"trader_pnl_stats","outputSchema":{"additionalProperties":true,"type":"object"},"title":"Trader Pnl Stats"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"Live stats of our on-chain address registry (block scanner):\nhow many active addresses collected, scan height, freshness.\nReturns addresses_total, scanned_up_to_height (last ingested dYdX\nblock), seen_last_24h (addresses seen in the last 24h) and the sqlite\npath. On hosts where the optional scanner has not run, returns a\nnote instead — market/trader tools still work via the public indexer.\nExample: registry_stats()","inputSchema":{"additionalProperties":false,"properties":{},"type":"object"},"name":"registry_stats","outputSchema":{"additionalProperties":true,"type":"object"},"title":"Registry Stats"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"openWorldHint":true,"readOnlyHint":true},"description":"Recently active trader addresses from the block-scanner registry\n(high-frequency validator committers filtered out by max_hits).\nEach row: address, hits (chain appearances), first_seen / last_seen,\nlast_height. Returns {\"total\", \"count\", \"offset\", \"has_more\",\n\"next_offset\", \"traders\"}; traders == [] when the registry is not\nbuilt on this host. Page with offset when has_more is true.\nFeed an address into trader_profile / trader_pnl_stats next.\nExample: list_traders(limit=10, max_hits=100)","inputSchema":{"additionalProperties":false,"properties":{"limit":{"default":10,"type":"integer"},"max_hits":{"default":100,"type":"integer"},"offset":{"default":0,"type":"integer"}},"type":"object"},"name":"list_traders","outputSchema":{"additionalProperties":true,"type":"object"},"title":"List Traders"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"openWorldHint":true,"readOnlyHint":true},"description":"Screener: funded, recently active traders discovered from the chain —\nregistry candidates probed for live equity. Start here, then analyze\neach with trader_profile. Each row: address, equity (USD, >=\nmin_equity), registry_hits, last_seen.\nExample: discover_traders(limit=5, min_equity=100.0)","inputSchema":{"additionalProperties":false,"properties":{"limit":{"default":5,"type":"integer"},"min_equity":{"default":100.0,"type":"number"}},"type":"object"},"name":"discover_traders","outputSchema":{"properties":{"result":{"items":{"additionalProperties":true,"type":"object"},"type":"array"}},"required":["result"],"type":"object","x-fastmcp-wrap-result":true},"title":"Discover Traders"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"openWorldHint":true,"readOnlyHint":true},"description":"Verified trader leaderboard from our registry + PnL engine\n(batch-computed). metric: pnl_window | pnl_total | equity | day_winrate.\nFarmer flags mark likely rewards-farming bots (heuristic v0).\nEach row (USD where monetary): address, equity, pnl_total, pnl_window,\nday_winrate (pct 0-100), max_dd (pct), maker_share, avg_fill,\nfarmer_flag (bool), identity_residual. Requires a batch run — otherwise\nreturns {\"error\": \"no leaderboard run yet — run leaderboard.py first\"}.\nExample: leaderboard(limit=20, metric=\"pnl_window\")","inputSchema":{"additionalProperties":false,"properties":{"limit":{"default":20,"type":"integer"},"metric":{"default":"pnl_window","enum":["pnl_window","pnl_total","equity","day_winrate"],"type":"string"},"offset":{"default":0,"type":"integer"}},"type":"object"},"name":"leaderboard","outputSchema":{"additionalProperties":true,"type":"object"},"title":"Leaderboard"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"Latest anomaly events from our detectors: funding_extreme,\noi_spike_no_price, equity_jump, liq_cascade_signature. Each row: ts,\nkind, subject (ticker or address) and payload (dict of detector\nnumbers). Optional kind filter; offset pages past the newest slice\n(events are pruned at 5000 — offset+limit beyond that returns []).\nSubscribe via webhooks/Telegram (alerts).\nExample: latest_events(limit=20, kind=\"funding_extreme\")","inputSchema":{"additionalProperties":false,"properties":{"kind":{"anyOf":[{"enum":["funding_extreme","oi_spike_no_price","equity_jump","liq_cascade_signature"],"type":"string"},{"type":"null"}],"default":null},"limit":{"default":20,"type":"integer"},"offset":{"default":0,"type":"integer"}},"type":"object"},"name":"latest_events","outputSchema":{"properties":{"result":{"items":{"additionalProperties":true,"type":"object"},"type":"array"}},"required":["result"],"type":"object","x-fastmcp-wrap-result":true},"title":"Latest Events"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"One-call market briefing: latest detector events + funding extremes\n(liquid markets only) + verified leaderboard top. The daily briefing\nan agent (or human) needs before anything else.\nReturns: events (up to 5, payload flattened into each row), funding\n(top-5 funding rows, markets with >= $100k OI) and leaderboard_top\n(top-3 by pnl_window: address, pnl_window, equity, day_winrate).\nExample: market_digest()","inputSchema":{"additionalProperties":false,"properties":{},"type":"object"},"name":"market_digest","outputSchema":{"additionalProperties":true,"type":"object"},"title":"Market Digest"},{"_meta":{"fastmcp":{"tags":[]}},"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"Tool-call counters since deployment (traction/uptime metrics).\nReturns calls_total, calls_24h, calls_7d and top_tools (top-5\n(tool, count) pairs) recorded by this gateway instance.\nExample: usage_stats()","inputSchema":{"additionalProperties":false,"properties":{},"type":"object"},"name":"usage_stats","outputSchema":{"additionalProperties":true,"type":"object"},"title":"Usage Stats"}]}}}
