aster-agent-gateway
This server is a read-only MCP gateway exposing Aster DEX market data (futures, spot, funding, TradFi perps, deposits, account views) to AI agents via 13 tools.
Market overviews: futures and spot panels with volumes, changes, statuses, and fresh listings.
Symbol universe: exchange symbols with filters, precisions, min notional, step size, leverage; junk filtering.
Order books: depth snapshots for futures and spot with weight-aware limit snapping.
Klines: OHLCV for last/mark/index price types on futures, spot via sapi; multiple intervals.
Trades: recent keyless trades for futures (spot probed honestly).
Funding analysis: overview of all rates with intervals, caps/floors, next funding time; screener for annualized rates, premium, mark-index spread, and headroom to cap/floor.
TradFi screener: 24/7 perp markets (metals, equity, energy, treasuries, forex) with volumes/funding and BTC correlation.
Open interest snapshot: per-symbol OI (max 10 symbols/call); no fake history.
Deposit flows: Solana vault signatures and optional EVM chain transfers with hourly stats.
Account view: keyless balance/open orders/fills for any address; honest privacy errors.
Mark-index divergence: ranks markets by mark vs index spread with kline cross-check on top divergences.
Enables read-only queries of Solana vault deposit flows, including keyless vault signatures and deposit statistics, for monitoring capital movements into Aster DEX vaults.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@aster-agent-gateway screen the top funding rates on Aster DEX"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
aster-agent-gateway
Aster lists roughly 580 futures, and about 32 of them are things you would not expect on a crypto DEX: gold, oil, treasuries, single equities and index perps that trade 24/7 while the underlying market sleeps. This MCP server puts the whole board, plus ~68 spot pairs, funding, order books, klines and vault deposit flows, in front of an AI agent. Read-only and keyless; public endpoints only (fapi.asterdex.com/fapi/v3, sapi.asterdex.com/api/v3, tapi.asterdex.com/info, Solana RPC, optional EVM RPCs), cached and rate-limited.
Use cases
Funding first, because this is where Aster is different. Intervals vary per market, 1h to 8h; annualize naively and an 8h market reads 8x too cold. The screener computes every row from its own interval and shows cap/floor next to it, so a 4,148%/yr print comes with the context that explains it.
Then the TradFi board at 3am: gold at $4,365 with live volume, oil paying longs to hold (negative funding, -0.0001%/1h when we looked), Micron up 4.8% overnight. One API, same conventions as the crypto rows.
mark_index_divergence ranks all ~756 markets by mark-vs-index spread. The morning we captured it, RTXUSDT topped both that board (505 bps rich) and the funding board at once, which is the classic pre-squeeze picture. Vault deposit flows show who parks capital where; OI snapshots are per-symbol and honest about the fact that Aster has no keyless OI history.
Full walkthroughs: examples/use-cases.md.
Related MCP server: asterdex-mcp-server
Quickstart
Claude Code:
claude mcp add aster -- uvx aster-agent-gatewaystdio (default, for local agents):
uvx aster-agent-gatewayor from a checkout:
git clone https://github.com/alekskram/aster-agent-gateway
cd aster-agent-gateway
uv sync
uv run aster-agent-gatewayClaude Desktop / Cursor config:
{
"mcpServers": {
"aster": {
"command": "uvx",
"args": ["aster-agent-gateway"]
}
}
}Hosted form, streamable HTTP on port 8904:
uvx aster-agent-gateway --http # 127.0.0.1:8904
curl http://127.0.0.1:8904/health # -> {"ok": true, "service": "aster-agent-gateway", ...}[mcp_servers.aster]
command = "uvx"
args = ["aster-agent-gateway"]# 1) start the gateway (keep it running)
uvx aster-agent-gateway --http --port 8904 &
# 2) register it (merges into ~/.zcode/cli/config.json)
python3 - <<'PY'
import json, os
p = os.path.expanduser("~/.zcode/cli/config.json")
os.makedirs(os.path.dirname(p), exist_ok=True)
cfg = json.load(open(p)) if os.path.exists(p) else {}
cfg.setdefault("mcp", {}).setdefault("servers", {})["aster"] = {
"type": "http", "url": "http://127.0.0.1:8904/mcp"}
json.dump(cfg, open(p, "w"), indent=2)
print("aster-agent-gateway registered:", p)
PYTools
All 13 tools are read-only (annotated readOnlyHint: true, destructiveHint: false).
# | Tool | Signature | What it does |
1 |
|
| Futures panel from ONE ticker/24hr ALL call joined with exchangeInfo: TRADING markets, top volumes, status counts, fresh listings (onboardDate). |
2 |
|
| Symbol universe with filters/precisions incl. MIN_NOTIONAL, stepSize, leverageFilter; TEST*/SETTLING junk filtered by default. |
3 |
|
| fapi depth / sapi api/v3 depth; limit snapped to a priced tier (weight-aware). |
4 |
|
| last/mark/index klines on fapi; spot via sapi. |
5 |
|
| Fresh keyless trades; spot path probed live (honest error dict if dead). |
6 |
|
| Spot pairs from sapi ticker/24hr + exchangeInfo; TEST* junk filtered. |
7 |
|
| All ~730 rates from premiumIndex + fundingInfo: mixed 1/2/4/8h intervals (flagged), cap/floor, interestRate, nextFundingTime. |
8 |
|
| TradFi-perp screener by asset class (metals/equity/energy/treasuries/forex) + |
9 |
|
| One-call ranking by annualized funding, premium, mark-index spread + |
10 |
|
| Per-symbol openInterest (max 10 symbols/call). No keyless OI history (404) - stated honestly. |
11 |
|
| Solana vault signatures (keyless) + EVM vault Transfers when |
12 |
|
| tapi |
13 |
|
| mark vs index spread screener from ONE premiumIndex call + markPriceKlines-vs-klines crosscheck on the top 3. |
Why a gateway and not the raw API?
Aster's fapi/sapi/tapi endpoints are plain REST. The traps are in the semantics:
Raw API gives you | You would have to build |
per-market funding intervals that differ (1h to 8h) | correct annualization per symbol; a naive ×24×365 overstates 8h markets by 8× |
funding cap/floor fields under live vs legacy names | name negotiation with fallback (this gateway reads |
~580 symbols mixing crypto, TradFi 24/7 perps and spot | chain/asset-class filtering, spot index dislocation ranking, capacity filtering where OI is not published |
three separate API surfaces (futures/spot/tapi) + Solana | one tool surface with consistent symbol handling and per-field source tags |
Rate limits
Two REST buckets, locally enforced and weight-aware:
fapi 2400 weight/min, sapi 6000/min (header
X-MBX-USED-WEIGHT-1Mread after every call). Above 80% of a bucket the client self-throttles; 429 backs off honoringRetry-After; a 418 (repeated 429 = IP ban) triggers a 60s refusal cooldown. Depth/kline limits snap to priced tiers so callers cannot accidentally burn weight.Solana 10 req/min, tapi 30/min, EVM 20/min local budgets (separate ledgers, fail-fast honest errors).
TTL caches: exchangeInfo 3600s, fundingInfo 600s, premiumIndex and tickers 15s, depth 5s, klines 60s, trades 10s, openInterest 30s.
Data notes
Every numeric from the API is a STRING upstream; parsed with a never-raising helper -
nullalways means "not available", never zero.Every upstream failure returns an error dict
{"error", "source", "reason"}, never a traceback.No OI history exists keyless (
/futures/data/openInterestHist404s) - the gateway says so instead of inventing data.EVM vault logs need
ASTER_EVM_RPC_URL(or per-chainASTER_EVM_RPC_URL_{BSC,ETH,ARB}); free public RPCs reject vault queries with -32005. Unset -> honest "no RPC configured".tapi account privacy: most accounts are private; empty results are reported as privacy, not as data.
Cached responses carry
age_seconds/fetched_atfreshness fields.
Part of the suite
Four sibling read-only MCP gateways, one style: keyless, cached, honest degradation.
Gateway | Focus |
dYdX v4: verified trader PnL, funding/OI anomaly detectors, leaderboard | |
194 tokenized US equities on Robinhood Chain: quotes, holders, whale transfers | |
Hyperliquid: 233 perps + spot, funding carry, account risk, HyperEVM | |
aster-agent-gateway (you are here) | Aster DEX: ~580 futures incl. 24/7 TradFi perps, funding caps/floors |
All four are on glama.ai and PyPI; any of them installs with uvx <name>.
License
MIT.
Available Tools
13 toolsaccount_viewAccount ViewARead-only
Keyless tapi account read for ANY address (Aster Chain
JSON-RPC): aster_getBalance / aster_openOrders / aster_userFills
(+ spot variants when they exist). Account privacy hides most
accounts: a privacy-empty result returns an honest error dict
explaining WHY (privacy, not an API failure).
data in {balance (default), openOrders, userFills, spotBalance,
spotOpenOrders, spotUserFills}.
Example: account_view(address="0x...")
Inputs: address (required), data. Returns: object
deposit_flowsDeposit FlowsARead-only
Vault deposit flows: Solana getSignaturesForAddress on the
Aster vault program (keyless) + EVM eth_getLogs Transfer-to-vault
on BSC/ETH/ARB when ASTER_EVM_RPC_URL* is configured; plus the D4
sub-block deposit_stats: hourly buckets and chain breakdown of
what was fetched. chain_filter in {all (default), solana, bsc,
eth, arb}. Example: deposit_flows(limit=20)
Inputs: limit, chain_filter. Returns: object
exchange_symbolsExchange SymbolsARead-only
Symbol universe with filters/precisions/statuses incl. the micro
view (MIN_NOTIONAL, stepSize, leverageFilter kind). Junk filter:
TEST* spot names and SETTLING futures statuses are hidden unless
include_junk=True. venue in {futures, spot, both}. Single-symbol
detail when symbol given.
Example: exchange_symbols(venue="futures", symbol="BTCUSDT")
Inputs: venue, symbol, include_junk. Returns: object
funding_overviewFunding OverviewARead-only
Funding panel from premiumIndex ALL + fundingInfo: all ~730
rates with intervals (1/2/4/8h mixed - flagged honestly), cap/
floor, interestRate, nextFundingTime. sort in {rate (default),
interval}. Example: funding_overview(limit=10)
Inputs: sort, limit. Returns: object
funding_screenerFunding ScreenerARead-only
One-call ranking of ALL markets by annualized funding rate, by
premium, by mark-index spread; plus the D1 sub-block
funding_regime: distance to cap/floor (headroom bps) per market
from fundingInfo. direction in {both (default), long, short} -
long = positive rates (longs pay), short = negative.
Example: funding_screener(top=5)
Inputs: top, direction. Returns: object
klinesKlinesARead-only
Klines (OHLCV). price_type last|mark|index selects fapi klines/markPriceKlines/indexPriceKlines; spot goes to sapi /api/v3/klines (price_type ignored). intervals 1m..1M; limit snapped to a priced tier (max 1000). Example: klines(symbol="BTCUSDT", interval="4h", limit=50)
Inputs: symbol (required), limit, market, interval, +1 more. Returns: object
market_overviewMarket OverviewARead-only
Futures market overview from ONE ticker/24hr ALL call joined
with exchangeInfo: panel of TRADING markets (symbol, last, 24h
change %, quote volume, trades count), top volumes, status counts,
and fresh listings (newest onboardDate, N rows).
sort in {volume (default), change, listings}. limit max 100.
Example: market_overview(limit=10)
Inputs: sort, limit. Returns: object
mark_index_divergenceMark Index DivergenceARead-only
Mark/index divergence screener from ONE premiumIndex call (markPrice vs indexPrice spread), cross-checked with markPriceKlines vs klines for the widest divergences (up to 3 symbol-pairs of klines, weight-economical). Example: mark_index_divergence(limit=10)
Inputs: limit. Returns: object
oi_snapshotOi SnapshotARead-only
Open interest snapshot. openInterest is a per-symbol endpoint
ONLY (each symbol = 1 call); N is capped at 10 per invocation.
There is NO keyless OI history (/futures/data/openInterestHist
404s) - stated honestly, never invented. When symbols is None
the top-volume futures symbols are used.
Example: oi_snapshot(symbols=["BTCUSDT", "ETHUSDT"])
Inputs: top, symbols. Returns: object
order_bookOrder BookARead-only
Aggregated order book: fapi /depth (futures) or sapi /api/v3/ depth (spot). The requested depth is snapped to the nearest priced tier (weight-aware: 5/10/20/50=2, 100=5, 500=10, 1000=20 weight). Example: order_book(symbol="BTCUSDT", depth=20)
Inputs: symbol (required), depth, venue. Returns: object
spot_overviewSpot OverviewARead-only
Spot market overview: sapi ticker/24hr ALL joined with exchangeInfo. The spot ticker list carries ~24k ephemeral BTC_UP_DOWN_5M_* options rows that never appear in exchangeInfo; the join keeps only listed symbols with status TRADING (~68 pairs). TEST* junk filtered by name. Example: spot_overview(limit=10)
Inputs: limit. Returns: object
tradesTradesARead-only
Recent trades. Futures fapi /trades is keyless and fresh. The spot /trades path was uncertain at recon time - probed live in smoke; if dead the tool returns an honest error dict. Example: trades(symbol="BTCUSDT", limit=10)
Inputs: symbol (required), limit, venue. Returns: object
tradfi_marketsTradfi MarketsARead-only
TradFi-perp screener (24/7 markets): local asset-class map by
baseAsset (metals, equity-index, equity-single, energy, treasuries,
forex) with per-class volumes/prices/funding, plus the D3 sub-block
tradfi_crypto_corr: rolling correlation of a TradFi representative
vs BTC computed locally from klines (at most 2 klines calls, cached
when possible; honest note when data is insufficient).
window in {24h, 7d, 30d} selects the correlation window.
Example: tradfi_markets(limit=10, window="7d")
Inputs: limit, window. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 13 tools
Most tools target distinct data views, but funding_overview, funding_screener, and mark_index_divergence all draw on premiumIndex/funding data and could be confused; spot_overview and the generically named market_overview also overlap in concept. The descriptions clarify the differences, though an agent must read them closely.
All names are lowercase snake_case and follow a noun-centric pattern such as *_overview, *_screener, *_snapshot, and *_view. The pattern is mostly predictable, with minor deviations like bare 'trades'/'klines' and the asymmetric 'market_overview' next to 'spot_overview'.
13 tools is a reasonable size for a read-only market/on-chain data gateway. Each tool covers a distinct data view or screener, with no obvious filler or redundant bulk; this sits comfortably in the well-scoped range.
The surface covers the core read-only workflows: market references, order-book data, OHLCV, funding, OI, TradFi correlation, deposits, and account state. Minor gaps exist, such as no single-symbol 24h ticker helper and no OI history, but these are workaroundable or explicitly out of scope.
Maintenance
Related MCP Connectors
Market data for agents: perps, OI, funding, Solana wallet swaps. Paid per call in USDC over x402.
Market and on-chain crypto data for AI agents. Pay per call in USDC on Base (x402).
Pay-per-call DeFi and macro intel for AI agents. x402 USDC tools via streamable HTTP /api/mcp.
Pay-per-call MCP tools for agents via x402 USDC: Korean data, onchain, crypto, web and AI tools.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that provides structured access to Aster DEX market data—covering candlesticks, order books, trades, and funding rates.115MIT
- AlicenseNot gradedqualityCmaintenanceA comprehensive MCP server for Aster DEX perpetual futures trading, enabling AI agents to access real-time market data, perform institutional-grade analysis, execute orders, and run automated trading strategies.1MIT

PredMCPofficial
AlicenseNot gradedqualityDmaintenanceSafe, read-only market data for AI trading agents, offering 44 tools to query prediction markets, perpetuals, and cross-venue signals without the ability to execute trades.1MIT- AlicenseAqualityBmaintenanceProvides AI agents read-only, keyless access to Hyperliquid market data, funding rates, account risk, and HyperEVM token transfers through MCP tools, with caching and rate limiting to protect upstream APIs.1239 PyPI1MIT