Rubin Exchange

trade.rubin由 rubin.trade 发布官方发布者v1.0.2更新于 Oct 24, 2026

Rubin: self-custody DEX for crypto perpetuals & spot - trade, read positions, orders, balances.

已验证Streamable HTTP可网页运行金融数据与分析

概览

AI 生成的概览

Rubin 自托管去中心化交易所的远程 MCP 服务器,让助手读取永续与现货行情、查看账户余额与持仓,并下单或撤单。

可以做什么
  • 发现市场并读取实时数据:市场列表与详情、订单簿、多周期 K 线、区块高度、新闻头条与盈亏排行榜
  • 查看账户:身份与代币权限范围、保证金与钱包余额、权益、持仓、未成交订单、成交记录、历史盈亏、保证金风险与手续费等级
  • 交易:下限价单与市价单、开仓并可附带止损止盈、平掉单个或全部持仓
  • 管理订单:撤销单笔订单、撤销某市场全部订单、批量撤销短期订单
  • 账户内资金调拨:将 USDC 从钱包存入交易子账户、补充 gas 储备
  • 查询返佣计划状态与自身排行榜名次
适用场景
适合希望助手在 Rubin 上交易或监控加密永续与现货的场景,例如查看持仓与保证金状况、读取行情,或在聊天客户端中下单和管理订单。适用于已有 Rubin 账户、希望用受限代币进行代理交易的用户。
运行要求
远程 streamable-HTTP 端点 mcp.mainnet.rubin.trade,无需本地安装包。需要 Rubin 交易所账户,以及在交易所铸造的免费 MCP 代币,通过 Authorization bearer 请求头发送。需要能访问该端点的网络。
安装前请注意
该代币可授权在主网进行真实交易并动用真实资金;服务器说明其权限范围不能提现或转账,但下单、平仓以及在钱包与子账户之间存入 USDC 都会改变资金与状态。市价单和止损止盈触发按订单簿价格成交,存在滑点上限,可能产生亏损。请妥善保管代币,泄露后立即撤销。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Rubin Exchange,将其添加到工作区。
  2. 连接 Authorization token 凭据。它们会被私密存储,绝不会在公开页面上展示。
  3. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/trade.rubin%2Fexchange/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "mcpServers": {
    "rubin-exchange": {
      "type": "http",
      "url": "https://mcp.mainnet.rubin.trade/mcp",
      "headers": {
        "Authorization": "Bearer <YOUR_TOKEN>"
      }
    }
  }
}

README

Rubin MCP server (mainnet)

Trade crypto perpetual futures and spot on Rubin — a self-custody decentralized exchange — directly from AI agents and assistants via the Model Context Protocol (MCP).

Rubin runs a hosted, remote MCP server (streamable-HTTP). Connect any MCP client (Claude, Cursor, VS Code, etc.) and let agents place and manage orders and read live market and account data. You keep custody of your funds — trading is authorized by a scoped token you mint yourself.

Tools

  • Market data — list markets, order book, candles, market stats, block height
  • Account — balances, equity, positions, open orders, fills, PnL
  • Trading — place / cancel limit & market orders, stop-loss, take-profit, cancel-all, batch-cancel

Authentication

Send an Authorization: Bearer <token> header. Mint a free MCP token on the Rubin exchange:

https://rubin.trade → Trading Keys → MCP Token

Connect

Claude Code / CLI

bash
claude mcp add --transport http rubin https://mcp.mainnet.rubin.trade/mcp \  --header "Authorization: Bearer <YOUR_MCP_TOKEN>"

Generic mcp.json (Claude Desktop / Cursor / others)

json
{  "mcpServers": {    "rubin": {      "type": "streamable-http",      "url": "https://mcp.mainnet.rubin.trade/mcp",      "headers": { "Authorization": "Bearer <YOUR_MCP_TOKEN>" }    }  }}

VS Code (GitHub Copilot) — .vscode/mcp.json

json
{  "servers": {    "rubin": {      "type": "http",      "url": "https://mcp.mainnet.rubin.trade/mcp",      "headers": { "Authorization": "Bearer <YOUR_MCP_TOKEN>" }    }  }}

See code.rubin.trade/ai for ready-made snippets for every client.

Manifest

server.json — the MCP Registry manifest for this server.

Links

License

MIT

来源:README.md,提交 d084c4b

工具

33

whoami

Describe this session

Report what this session controls: the master account (its address in BOTH forms — cosmos rit1… and EVM 0x…, the same 20 bytes), the subaccount, whether it can trade or is read-only, and the exact on-chain authorization scope (which messages, which subaccount, and that it CANNOT withdraw/transfer). Also states what this session can NOT do: create wallets, reveal keys/mnemonics, or switch accounts. Call this first, and use it to answer "what is my address?".

无需输入参数。

get_block_height

Get latest block height

Return the latest chain block height. Useful for SHORT_TERM order goodTilBlock math.

无需输入参数。

list_markets

List perpetual markets

List all perpetual markets with ticker, status and oracle price. Use this first to discover valid market tickers (e.g. BTC-USD) before placing orders.

无需输入参数。

get_market

Get a perpetual market

Get details for one perpetual market (clobPairId, atomicResolution, quantumConversionExponent, tick/step sizes, oracle price, status).

输入参数market必填

get_orderbook

Get orderbook

Get the live orderbook (bids/asks) for a market, optionally truncated to a depth.

输入参数depthmarket必填

get_candles

Get candles (OHLCV)

Get OHLCV candles for a market at a given resolution. Useful for trend/volatility analysis.

输入参数limittoISOmarket必填fromISOresolution必填

get_candles_multi

Get multi-timeframe candles

Get recent OHLCV candles for a market across MULTIPLE resolutions in one call — by default ALL indexer resolutions (1MIN, 5MINS, 15MINS, 30MINS, 1HOUR, 4HOURS, 1DAY) — so the agent can read the trend across timeframes at once. Returns { candles: { <resolution>: [...] } }, newest first. Lower `limit` (e.g. 20) or pass a `resolutions` subset to keep the payload small.

输入参数limitmarket必填resolutions

get_balance

Get balances

Get the subaccount collateral (USDC asset position) and the on-chain wallet bank balances. Collateral is what backs trading; the WALLET balance is where money sent to the account lands and is NOT collateral until deposited. `funding` summarizes it: depositableUsdc (wallet minus the $0.95 gas reserve) and a suggestedAction — deposit_to_subaccount when the wallet holds spare USDC, top_up_gas when gas is low.

无需输入参数。

get_equity

Get account summary

Get the subaccount summary: equity, freeCollateral, marginEnabled, open perpetual positions and asset positions.

无需输入参数。

get_positions

Get perpetual positions

Get perpetual POSITIONS with size, side, entryPrice, unrealizedPnl, realizedPnl and netFunding. Defaults to OPEN positions. NOTE: a position is what you HOLD after an order fills — it is NOT an open order. When the user asks loosely "what is open?", check BOTH this and get_open_orders (or call get_portfolio for both at once).

输入参数status

get_open_orders

Get open orders

Get currently active ORDERS for the subaccount, optionally filtered by market and side. Includes OPEN resting orders and UNTRIGGERED conditional orders (TP/SL accepted on-chain but not yet triggered). Returns { orders: [...] }. This does NOT include filled positions — a filled market/limit order leaves NO open order, it becomes a POSITION (see get_positions). When there are 0 orders but open positions exist, the result carries a `note` pointing you there.

输入参数sidelimitmarket

get_portfolio

Get full portfolio

One-call snapshot of everything the account has "open": equity & freeCollateral, every open POSITION (with notional, unrealized PnL and estimated liquidation price), every active ORDER (resting + untriggered TP/SL), and account margin risk. Use this to answer "what do I have open?" or "how am I doing?" without worrying whether the user means orders or positions — it returns both.

无需输入参数。

get_position_risk

Get position risk

Margin health for the subaccount: equity, freeCollateral, total maintenance/initial margin, maintenanceMarginBufferUsd (the EXACT liquidation guard — liquidatable when < 0), marginUsageRatio (1.0 = at liquidation), account leverage, and per-position estimated liquidation price + distance to it. Use before adding risk or to decide whether to protect/close a position.

无需输入参数。

get_fills

Get fills (trade history)

Get executed fills for the subaccount, including price, size, fee and maker/taker liquidity.

输入参数pagelimitmarket

get_pnl

Get historical PnL

Get historical PnL ticks for the subaccount (equity, totalPnl, netTransfers over time). Use createdOnOrAfter to bound the range.

输入参数pagelimitcreatedOnOrAfter

get_funding_status

Wallet vs trading-account funds

Where the account's USDC sits: in the WALLET (bank balance — money sent to the account lands here and is NOT collateral) vs in the trading SUBACCOUNT (equity / free collateral). Returns depositableUsdc (wallet minus the $0.95 gas reserve), whether gas is low, and a suggestedAction (deposit_to_subaccount / top_up_gas / null). Call this when the user says they sent funds, when collateral reads 0, or before any funding decision.

无需输入参数。

deposit_to_subaccount

Move wallet USDC into the trading account

Deposit USDC from the account's WALLET into its trading SUBACCOUNT so it becomes collateral. Without amountUsd it moves everything above the $0.95 gas reserve (what the web app does); with amountUsd it moves exactly that much, as long as $0.95 stays in the wallet. Funds never leave the account — this is an internal transfer the trading key is allowed to make. Use it when the user has sent money to the account and the subaccount collateral is 0 or too low to trade.

输入参数amountUsd

top_up_gas

Restore the wallet gas reserve

Move a little USDC from the trading subaccount back to the WALLET when the wallet is at or below $0.55 — just enough to restore the $0.95 gas reserve that deposit/withdraw transactions need. Only the gas reserve, only to the account's own wallet; it cannot send funds anywhere else. Use after a transaction fails for lack of gas.

无需输入参数。

place_limit_order

Place a limit order

Place a limit order. Default timeInForce=GTT (long-term, durable, broadcast-commit so errors return synchronously). Use SHORT_TERM only for latency-sensitive orders (expire within ~20 blocks, broadcast async). NOTE: stateful (GTT) orders are rate-limited to 2/block and 20 per 100 blocks — pace placements. Returns `confirmation` with the REAL outcome verified via the indexer (filled / partially_filled / resting / unfilled / pending) — broadcast `code: 0` only means the tx was accepted, NOT that it filled. Report from `confirmation.outcome`; if it is `pending`, the indexer is lagging — re-check shortly.

输入参数side必填size必填price必填market必填confirmclientIdpostOnlyreduceOnlytimeInForcegoodTilBlockOffsetgoodTilTimeSeconds

place_market_order

Place a market order

Place an IOC market order. It executes as an IOC limit at a worst-acceptable price mirrored around the oracle by side — BUY caps ABOVE the oracle, SELL below — at slippageBps distance (default 500 = 5%). Fills happen at book prices; the cap only limits how deep the sweep goes. reduceOnly closes an existing position. Returns `confirmation` with the REAL outcome verified via the indexer (filled / partially_filled / unfilled / pending): broadcast `code: 0` only means the tx was accepted — an IOC order cancels UNFILLED when the book is entirely beyond the slippage cap (thin/spread market). Always report from `confirmation.outcome`, not `code`; if `unfilled` or `partially_filled`, retry with a larger slippageBps to sweep deeper; if `pending`, the indexer is lagging — wait a few seconds and re-check before concluding.

输入参数side必填size必填market必填confirmclientIdreduceOnlyslippageBps

cancel_order

Cancel an order

Cancel a single order by clientId. For SHORT_TERM pass goodTilBlock; for LONG_TERM/CONDITIONAL pass goodTilTimeSeconds (the original good-til value, available from get_open_orders). Returns `confirmation` with the verified result (canceled / still_open / filled / pending): `code: 0` only means the cancel was broadcast. If `still_open`, the goodTil value likely did not match the original — retry.

输入参数market必填confirmclientId必填orderFlags必填goodTilBlockgoodTilTimeSeconds

cancel_all_orders

Cancel all orders in a market

Cancel every OPEN order for the subaccount in a market (handles SHORT_TERM and LONG_TERM automatically). Returns `confirmation.remainingOpen` — orders still OPEN after the cancel (0 = all gone); if > 0, retry.

输入参数market必填confirm

batch_cancel

Batch cancel short-term orders

Cancel multiple SHORT_TERM orders in one tx. SHORT_TERM only (chain limitation) — for stateful/mixed use cancel_all_orders.

输入参数market必填clientIds必填

place_stop_loss

Stop loss

Place a reduce-only Stop loss (conditional market order) that triggers at triggerPrice. Side must be the CLOSING side of the position: SELL closes a LONG, BUY closes a SHORT. Once triggered it executes as an IOC limit bounded at triggerPrice ± slippageBps in the direction of execution (BUY above the trigger, SELL below; default 500 bps) so the close can cross the book.

输入参数side必填size必填market必填clientIdslippageBpstriggerPrice必填

place_take_profit

Take profit

Place a reduce-only Take profit (conditional market order) that triggers at triggerPrice. Side must be the CLOSING side of the position: SELL closes a LONG, BUY closes a SHORT. Once triggered it executes as an IOC limit bounded at triggerPrice ± slippageBps in the direction of execution (BUY above the trigger, SELL below; default 500 bps) so the close can cross the book.

输入参数side必填size必填market必填clientIdslippageBpstriggerPrice必填

close_position

Close a position

Close all or part of an open perpetual position with a reduce-only MARKET order. Reads the current position, flips the side automatically (LONG→SELL, SHORT→BUY) and sizes the close. percent defaults to 100 (full close); a partial close is floored to the market step size. The close is bounded at oracle ± slippageBps mirrored by side (closing a SHORT buys up to oracle×(1+slip), closing a LONG sells down to oracle×(1−slip); default 500 bps = 5%). Returns the verified `confirmation` outcome — if it is `unfilled` or `partially_filled`, the book was thinner than the cap: re-run with a larger slippageBps to sweep deeper. Errors NOT_FOUND if there is no open position in the market.

输入参数market必填confirmpercentslippageBps

close_all_positions

Close all positions

Flatten EVERY open perpetual position with reduce-only MARKET orders (one per market). Respects the operator market allowlist (disallowed markets are skipped and reported). Each close is bounded at oracle ± slippageBps mirrored by side (default 500 bps = 5%). Returns a per-market result array — for any market reporting unfilled/partially_filled, re-run with a larger slippageBps.

输入参数confirmslippageBps

open_position

Open a position (market entry + optional bracket)

Enter a NEW position with a MARKET order, sized by base `size` OR quote `notionalUsd` (exactly one required; notionalUsd converts at the oracle price and is floored to the step size). Optionally attach a reduce-only stopLossPrice and/or takeProfitPrice as conditional orders in the SAME call (the bracket, placed with the opposite/closing side and a 500 bps execution bound past the trigger). slippageBps caps the entry fill vs oracle (default 500). Returns the entry `confirmation` plus any bracket order ids. Bracket legs are placed only if the entry broadcast succeeds; each is reduce-only so it can only close, never flip.

输入参数side必填sizemarket必填confirmnotionalUsdslippageBpsstopLossPricetakeProfitPrice

get_news

Get latest news

Fetch the latest headlines from the ritbit news feed (curated crypto / markets / business channels, newest first). Filter by `category` (crypto|markets|business) or explicit `channels`, and/or a free-text `query` (a ticker or keyword, matched in the post text and hashtags, e.g. BTC). Each item returns { source, url, publishedAt, tags (hashtags — where tickers appear), text }. There is NO importance field: judge impact yourself from the content (hacks, regulation, large moves, ⚠️ warnings). Use this to factor sentiment/catalysts into an assessment, or to answer "what's the latest?". Headlines are ru/en.

输入参数limitquerycategorychannelssinceHours

get_leaderboard

PnL leaderboard

The trader PnL leaderboard for a time span (ONE_DAY, SEVEN_DAYS, THIRTY_DAYS, ONE_YEAR, ALL_TIME): rank, username, address, PnL (USD), ROI (%) and current equity per trader, paginated. Also returns `me` — this account's own row on that board, if it is ranked. Use `search` to find a trader by username or address. For this account's rank across ALL time spans at once, use get_my_rank.

输入参数pagelimitsearchsortBytimeSpansortDirection

get_my_rank

My leaderboard rank

Where THIS account ranks on the PnL leaderboard: rank, board size ("21 of 66"), PnL, ROI and equity — for one time span, or for every time span (ONE_DAY … ALL_TIME) when none is given. A null entry means the account is not ranked on that board (no qualifying activity in the window).

输入参数timeSpan

get_fee_tier

My fee tier

This account's current trading fee tier and conditions: maker/taker fee (% of notional; a negative maker fee is a rebate), the 30-day maker/taker volume it is judged on, any staking discount, the next tier and how much more 30d volume it takes, plus the full fee-tier table. Referred users start at the program's minimum fee tier (see get_referral_program).

无需输入参数。

get_referral_program

My referral (affiliate) program

This account's referral / affiliate program status: referral code and link, whether the link is unlocked (lifetime volume threshold, or already an affiliate), current affiliate tier and taker-fee share, referred volume (30d / all-time), earnings and referred-user stats, who referred this account, the full affiliate tier table and the program parameters (referee starting fee tier, 30d caps).

无需输入参数。

版本历史

1
  1. v1.0.2最新Sep 16, 2026

评分

已满足适用检查项的 100%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分