Bsc Dex Spread

io.github.donnywin85由 GitHub 账号 donnywin85 发布v0.1.0更新于 Oct 24, 2026

Cross-DEX price & spread for PancakeSwap v2+v3 on BSC via x402. Tool get_dex_spread(pair, fee?).

已验证STDIO仅桌面金融数据与分析

概览

AI 生成的概览

本地 MCP 服务器,提供一个工具,返回 BSC 上 PancakeSwap v2 与 v3 的实时跨 DEX 价格与价差,按次以 USDC 付费。

可以做什么
  • 查询跨 DEX 定价:get_dex_spread 接收如 WBNB/USDC 的代币对和可选的 PancakeSwap v3 费率档位,并探测 v2 与各 v3 档位。
  • 返回各交易场所价格、最优买入与最优卖出场所、以基点计的毛价差、各场所与总流动性,以及数据来源区块号。
  • 可用于套利筛选、最优执行路径与滑点估算,无需自行运行 BSC RPC 基础设施或计算资金池。
适用场景
当助手需要 BSC 上新鲜且带区块标记的 PancakeSwap v2/v3 价差数据,且可接受按次计费、无需账户或 API key 时使用。README 指出已有免费且无需密钥的跨 DEX 价差替代方案,因此它更适合明确需要无上限付费通道的调用方。
运行要求
通过 npm 包 bsc-dex-spread-mcp 以 stdio 在本地运行(需要 Node.js,可用 npx 或全局安装)。需要 EVM_PRIVATE_KEY,即 0x 开头的 Base 主网钱包私钥,仅需充值 USDC(无需 ETH),因为每次调用在 Base 上花费 0.01 USDC。可选 GATEWAY_URL 可覆盖默认网关地址。需要能访问该网关的网络。
安装前请注意
私钥以明文形式保存在 MCP 客户端配置中,并用于签署 USDC 支付,因此应使用专用的低余额钱包,切勿使用主钱包。每次调用都会在 Base 主网花费 0.01 USDC。README 说明端到端的付费结算尚未验证,应视为未测试,并先进行小额调用。请求会发送至第三方网关。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Bsc Dex Spread,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

bsc-dex-spread

One MCP tool — get_dex_spread — returning live cross-DEX price and spread for PancakeSwap v2 + v3 on BSC, paid $0.01 USDC per call from your own wallet.

Try it in 30 seconds

Inspecting the server costs nothing and needs no wallet:

bash
npx -y bsc-dex-spread-mcp

It starts on stdio and lists its one tool. Add it to Claude Code:

bash
claude mcp add bsc-dex-spread --env EVM_PRIVATE_KEY=0xyour_disposable_base_key -- npx -y bsc-dex-spread-mcp

Without a key the tool is still listed, and a call tells you exactly what is missing rather than failing obscurely:

get_dex_spread failed: EVM_PRIVATE_KEY is not set. Add your funded Base-mainnetbuyer wallet key (0x-prefixed, USDC-only, low balance) to the MCP server env config.

Before you fund anything, know the free alternative. If you do not specifically need the paid, uncapped path, arb-dex-mcp and dex-data-mcp return cross-DEX spread keyless and free on six chains. This server exists for callers who want per-call billing with no free-tier ceiling — it is not the cheapest way in.

An MCP server that gives your agent one tool — get_dex_spread — returning real-time cross-DEX price & spread data for PancakeSwap v2 + v3 on BSC. Each call is a paid API call: $0.01 USDC on Base mainnet, settled automatically over x402 from your own wallet. No subscription, no account, no API key to request — the agent pays per call.

Backed by a live x402 gateway: https://x402.donnyautomation.com Public usage/proof page: https://x402.donnyautomation.com/stats

The tool

get_dex_spread(pair, fee?)

Real-time cross-DEX price & spread for PancakeSwap v2+v3 on BSC.

  • pair (required) — token pair as SYM/SYM; the first symbol is the USD-priceable side. Examples: WBNB/USDC, WBNB/USDT, CAKE/WBNB.
  • fee (optional) — a PancakeSwap v3 fee tier (100, 500, 2500, 10000) to restrict the v3 probe. Omit to probe all v3 tiers and v2.

Returns per-venue prices, best buy / best sell venue, the gross cross-DEX spread in bps, liquidity (per-venue TVL + totals), and the source block number. Example:

jsonc
{  "pair": "WBNB/USDC", "network": "bsc", "chainId": 56,  "blockNumber": 107562007, "nativeUsd": 546.6,  "pricesByVenue": [ { "venue": "pancake", "surface": "v2", "price": 546.6, "tvlUsd": 1234567 }, ... ],  "bestBuy":  { "venue": "pancakeV3:500", "price": ... },  "bestSell": { "venue": "biswap",        "price": ... },  "midSpreadBps": 27.4,  "crossDex": { "grossSpreadBps": 14.05, "buyVenue": "...", "sellVenue": "...", "surface": "v2v3" },  "liquidity": { "venues": 7, "totalTvlUsd": ... },  "ts": "2026-07-01T...", "source": "rpc"}

Why an agent wants this

Cross-DEX spread is the raw signal behind arbitrage, best-execution routing, and slippage estimation. Instead of running BSC RPC infrastructure and multi-DEX pool math itself, an agent calls one tool and pays a cent for a fresh, block-stamped answer across PancakeSwap v2 + v3 venues.

Cost & wallet model — read this

You bring the wallet. This package ships no keys. The server signs each payment with a private key it reads from its own environment (EVM_PRIVATE_KEY), which you set in your MCP client's server config. That is the design: the buyer (you) pays for the data with the buyer's wallet.

  • Per call: $0.01 USDC on Base mainnet (eip155:8453).
  • Fund USDC only — zero ETH needed. x402's exact scheme is EIP-3009 transferWithAuthorization: you sign an off-chain USDC authorization and the facilitator broadcasts it and pays the gas. A 0-ETH wallet settles fine.
  • Use a low-balance, dedicated wallet. Fund it with just a few dollars of USDC on Base and top it up as needed. Do not point this at your main wallet — the key sits in your MCP client config in plaintext, so treat it as a hot, disposable spending wallet.

Install & configure

bash
npm install -g bsc-dex-spread-mcp

Add it to your MCP client. Claude Desktop / Claude Code (claude_desktop_config.json or .mcp.json):

jsonc
{  "mcpServers": {    "bsc-dex-spread": {      "command": "npx",      "args": ["-y", "bsc-dex-spread-mcp"],      "env": {        "EVM_PRIVATE_KEY": "0xYOUR_BASE_MAINNET_BUYER_KEY"      }    }  }}

EVM_PRIVATE_KEY — your Base-mainnet buyer wallet key (0x-prefixed), funded with a few dollars of USDC on Base. Optional GATEWAY_URL overrides the endpoint (defaults to https://x402.donnyautomation.com).

Restart your client; the agent will have get_dex_spread available and will pay $0.01 USDC each time it calls it.

How it works

agent → get_dex_spread(pair)      → GET https://x402.donnyautomation.com/call?pair=...  (HTTP 402 PAYMENT-REQUIRED)      → sign EIP-3009 USDC auth with EVM_PRIVATE_KEY → x402 facilitator settles on Base      → gateway proxies to its BSC DEX reader → 200 with the cross-DEX payload

What has been verified, and what has not

Checked against the published artifacts on 2026-08-21:

  • npm install -g bsc-dex-spread-mcp and npx -y bsc-dex-spread-mcp both install and start; npm 0.1.0 matches this repo.
  • The gateway is live and answers GET /call?pair=WBNB/USDC with a valid x402 V2 challenge — 402, a payment-required header, $0.01 USDC (10000 at 6 decimals) on Base eip155:8453.
  • A keyless call reports the missing key clearly, as shown above.
  • Not verified: end-to-end paid settlement. Confirming it would mean spending real USDC, which this documentation pass was not authorised to do. The payment path is unexercised here, so treat it as untested rather than proven, and make your first call a small one.

Where to go next

License

MIT

来源:README.md,提交 142841c

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.0最新Sep 16, 2026

评分

已满足适用检查项的 50%

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

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分