dydx-agent-gateway
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| logging | {} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_marketsA | All dYdX v4 perpetual markets: oracle price, 24h volume, open interest, next funding rate. Sorted by 24h USD volume by default (or 'oi'). Each row: ticker, oraclePrice, volume24h_USD, openInterest_USD (size x oracle price) and nextFundingRate_pct_1h (pct per hour). Returns {"count_total", "count", "offset", "has_more", "next_offset", "markets", "summary"}; only ACTIVE markets — delisted/settled ones are excluded. Page with offset when has_more is true. Example: list_markets(limit=20, sort="volume") |
| market_detailA | One perpetual market in depth: prices, 24h stats computed from candles (the raw API priceChange field is unreliable), OI, funding. Returns oraclePrice, openInterest, nextFundingRate_pct_1h (pct/hour), volume24h_USD, change24h_pct_from_candles (24h pct change, computed from 25 x 1h candles), trades24h, basis_pct (mark-vs-oracle deviation in pct: (last candle close - oraclePrice) / oraclePrice x 100), and the latest three 1h candles (t/open/close/usdVolume). An unknown or delisted ticker raises an error (MCP isError) — settled markets are not served. Example: market_detail(ticker="BTC-USD") |
| candlesA | OHLCV candles with open interest for a market. resolution: 1MIN|5MIN|15MIN|30MIN|1HOUR|4HOURS|1DAY. Each candle: startedAt, open/high/low/close (price), baseTokenVolume (base-coin size), usdVolume (USD), startingOpenInterest. Rows are ordered oldest -> newest (the indexer sends newest-first; we normalize). limit is capped at 1000. Example: candles(ticker="ETH-USD", resolution="1HOUR", limit=100) |
| recent_tradesA | Latest public trades of a market (price, side, size, type, time). Newest first; limit capped at 100. side is BUY/SELL, size in base coin. Example: recent_trades(ticker="BTC-USD", limit=30) |
| trader_profileA | Snapshot of any trader's subaccount: equity, open positions, and PnL curve statistics (all-time window from up to 1000 history points). Returns equity_now / totalPnl_now / totalPnl_delta_window (USD), window_start / window_end, and open_positions (market, side, size, entry, unrealizedPnl in USD). Pair with trader_pnl_stats for deeper statistics. Example: trader_profile(address="dydx1m9hg73dtn5ku8ulmj8rjmdqh0hk7uuhawc69cn") |
| heightA | Current dYdX chain height and time — use for liveness checks. Returns {"height": current block number, "time": block timestamp}. Example: height() |
| funding_heatmapA | All markets ranked by |next funding rate| (1h, annualized). Shows which sides pay: positive = longs pay shorts. Rows carry OI so agents can ignore micro-markets; raise min_oi_usd to filter noise. Each row: ticker, funding_pct_1h (pct per hour), funding_pct_annualized (1h rate x 24 x 365), oi_usd, oraclePrice, and exactly one of longs_pay / shorts_pay = True. Zero-rate markets and markets below min_oi_usd are skipped. Returns {"count_nonzero", "top", "summary", "offset", "has_more"} — page with offset when has_more is true. Example: funding_heatmap(limit=15, min_oi_usd=100000.0) |
| market_taA | Technical snapshot computed from dYdX candles: RSI(14), EMA20/EMA50 trend, ATR(14) volatility, Bollinger(20,2) position, MACD(12,26,9), VWAP(20) and annualized realized vol. Pure local math — no external TA library. Key fields: price, trend_ema20_50 ("up"/"down"), rsi14 (0-100) and rsi_zone (overbought >70 / oversold <30 / neutral), atr14 (absolute) and atr_pct_of_price (pct), bollinger_pctB (0 = lower band, 1 = upper band), macd_line/signal_line/macd_hist (classic 12/26/9; hist > 0 = bullish momentum), vwap_20 (volume-weighted average price over the last 20 candles: typical price (H+L+C)/3 weighted by usdVolume) and realized_vol_annualized_pct (population std of log returns x sqrt(candles-per-year), scaled by resolution). Needs >=55 candles; returns {"error": ...} for thin markets. Example: market_ta(ticker="BTC-USD", resolution="1HOUR") |
| suggest_stopsA | ATR-based risk plan: stop-loss, take-profit, breakeven trigger and trailing level for a long/short entry. Agent-managed position helper. Unknown ticker (no oracle price) raises an error (MCP isError); returns {"error": ...} when no ATR is available (thin market). All output prices are in market price units: stop_loss / take_profit sit atr_mult_sl / atr_mult_tp x ATR(14) from entry (entry defaults to the current oracle price); breakeven_after is the price at +1 ATR in profit (then move SL to entry and trail by 1 ATR); risk_reward = TP distance / SL distance. Example: suggest_stops(ticker="BTC-USD", side="LONG", atr_mult_sl=1.5) |
| fills_reviewA | Execution review from the latest fills: maker/taker split, per-market distribution, traded volume, avg fill size. (Per-fill PnL is not exposed by the indexer; use trader_pnl_stats for win-rate.) Key fields: fills_sampled (count), maker_share_pct (0-100), sampled_volume_USD, avg_fill_USD, top_markets (top 5 by fill count). Returns {"summary": "no fills"} for accounts with no fills. Example: fills_review(address="dydx1m9hg73dtn5ku8ulmj8rjmdqh0hk7uuhawc69cn") |
| historical_fundingA | Raw 1h funding rate history of a market (as realized, not the next-rate preview in market_detail): each point is the rate actually paid that hour; annualized_pct = rate x 24 x 365 for scale. Default 168 points = 7 days. Points are ordered oldest -> newest (candles convention); limit capped at 500. Positive = longs paid shorts. An unknown or delisted ticker raises an error (MCP isError) — call list_markets for the valid set (format: 'ETH-USD'). Example: historical_funding(ticker="ETH-USD", limit=168) |
| raw_fillsA | Raw execution tape for a subaccount — every field the indexer gives, unchanged — for agents doing their own execution-quality math (the aggregated view lives in fills_review). Each fill: t (createdAt), market, side, liquidity (MAKER/TAKER), type, price, size (base coin), usd_notional (price x size), fee, and the position context (positionSideBefore / positionSizeBefore / entryPriceBefore). Newest first; limit capped at 1000. Addresses come from discover_traders / leaderboard / list_traders. Example: raw_fills(address="dydx1m9hg73dtn5ku8ulmj8rjmdqh0hk7uuhawc69cn") |
| cvdA | Cumulative Volume Delta from the latest public trades: running sum of +size on BUY / -size on SELL, oldest -> newest within the sample. Rising CVD = aggressive buying dominating. Volumes are in the base coin. Returns cvd_final (net aggressive flow), buy_volume / sell_volume, trade window bounds (t_first / t_last), trades_sampled and cvd_series_last (the last 50 running values — full series stays out of the response to keep it compact). An unknown or delisted ticker raises an error (MCP isError) — call list_markets for the valid set (format: 'ETH-USD'). Example: cvd(ticker="BTC-USD", trades_limit=500) |
| correlationA | Pearson correlation of two markets' log returns over candles: r in [-1, 1] plus beta(a|b) — the sensitivity of a to b (a moves beta x b's move, both in log space). Candle series are JOINED by startedAt (only candles with the same timestamp on both sides are compared), so partially-overlapping histories pair correctly. Both tickers are validated; call list_markets for the valid set (format: 'ETH-USD'). Returns {"error": ...} when there is insufficient or constant data. Example: correlation(ticker_a="BTC-USD", ticker_b="ETH-USD") |
| trader_pnl_statsA | Deep PnL statistics from the equity curve: daily PnL, day-winrate, max drawdown (deposit-adjusted), Sharpe-like daily ratio, and the data-accuracy reconciliation residual (phantom-PnL detector). NOTE: pass limit as keyword: trader_pnl_stats(addr, limit=500), NOT positionally (second positional arg is subaccountNumber). Key fields: day_winrate_pct (0-100), max_drawdown_pct (pct, net of deposits/withdrawals) with max_drawdown_usd (same drawdown in USD) and dd_pct_unreliable (true when the deposit-adjusted peak at the worst drawdown was near zero — trust the USD figure then), avg_daily_pnl / best_day / worst_day (USD per UTC day), sharpe_like_daily, identity_max_residual_usd (expect < $1 on clean data). limit: history depth in points — 1000 ≈ 42 days (default, fast), 5000 ≈ 7 months (slower, multi-page fetch). Example: trader_pnl_stats(address="dydx1m9hg73dtn5ku8ulmj8rjmdqh0hk7uuhawc69cn", limit=5000) |
| registry_statsA | Live stats of our on-chain address registry (block scanner): how many active addresses collected, scan height, freshness. Returns addresses_total, scanned_up_to_height (last ingested dYdX block), seen_last_24h (addresses seen in the last 24h) and the sqlite path. On hosts where the optional scanner has not run, returns a note instead — market/trader tools still work via the public indexer. Example: registry_stats() |
| list_tradersA | Recently active trader addresses from the block-scanner registry (high-frequency validator committers filtered out by max_hits). Each row: address, hits (chain appearances), first_seen / last_seen, last_height. Returns {"total", "count", "offset", "has_more", "next_offset", "traders"}; traders == [] when the registry is not built on this host. Page with offset when has_more is true. Feed an address into trader_profile / trader_pnl_stats next. Example: list_traders(limit=10, max_hits=100) |
| discover_tradersA | Screener: funded, recently active traders discovered from the chain — registry candidates probed for live equity. Start here, then analyze each with trader_profile. Each row: address, equity (USD, >= min_equity), registry_hits, last_seen. Example: discover_traders(limit=5, min_equity=100.0) |
| leaderboardA | Verified trader leaderboard from our registry + PnL engine (batch-computed). metric: pnl_window | pnl_total | equity | day_winrate. Farmer flags mark likely rewards-farming bots (heuristic v0). Each row (USD where monetary): address, equity, pnl_total, pnl_window, day_winrate (pct 0-100), max_dd (pct), maker_share, avg_fill, farmer_flag (bool), identity_residual. Requires a batch run — otherwise returns {"error": "no leaderboard run yet — run leaderboard.py first"}. Example: leaderboard(limit=20, metric="pnl_window") |
| latest_eventsA | Latest anomaly events from our detectors: funding_extreme, oi_spike_no_price, equity_jump, liq_cascade_signature. Each row: ts, kind, subject (ticker or address) and payload (dict of detector numbers). Optional kind filter; offset pages past the newest slice (events are pruned at 5000 — offset+limit beyond that returns []). Subscribe via webhooks/Telegram (alerts). Example: latest_events(limit=20, kind="funding_extreme") |
| market_digestA | One-call market briefing: latest detector events + funding extremes (liquid markets only) + verified leaderboard top. The daily briefing an agent (or human) needs before anything else. Returns: events (up to 5, payload flattened into each row), funding (top-5 funding rows, markets with >= $100k OI) and leaderboard_top (top-3 by pnl_window: address, pnl_window, equity, day_winrate). Example: market_digest() |
| usage_statsA | Tool-call counters since deployment (traction/uptime metrics). Returns calls_total, calls_24h, calls_7d and top_tools (top-5 (tool, count) pairs) recorded by this gateway instance. Example: usage_stats() |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/alekskram/dydx-agent-gateway'
If you have feedback or need assistance with the MCP directory API, please join our Discord server