
X402 Funding
io.github.kristoferbc由 GitHub 帳號 kristoferbc 發布v1.5.0更新於 Nov 3, 2026
Hyperliquid 與 Binance 或 OKX 的資金費率差異,按年化計算,並包含執行容量。
AI 翻譯由 AI 模型根據下方的原文描述翻譯,可能有誤。
原文描述
Hyperliquid funding divergence vs Binance or OKX, annualized, with execution capacity.
概覽
X402 Funding 的本機 MCP 服務;無需登入;STDIO。
暫無 AI 概覽:以下資訊來自註冊中心條目和服務本身。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 X402 Funding,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
[x402 funding MCP server – quality and maintenance score on Glama]
x402 Funding Divergence
[npm version] [npm downloads] [license] [node] [x402-funding MCP server]
Perpetual funding rates, compared across venues. Hyperliquid against a liquid CEX benchmark — Binance, or OKX where Binance restricts the region — annualized with each venue's real funding interval, filtered for pairs liquid on both legs, with the direction of the basis trade already resolved.
One call returns every pair where the two venues disagree, sorted by the size of the gap. No API keys, no signup, no rate-limit negotiation.
That trade field is the whole point: it tells you which leg to short and which to long, and it names the venue those numbers came from. No interpretation needed downstream.
Why this exists
A funding rate on one venue tells you what that venue thinks. The gap between two venues tells you how far apart their carry expectations sit — the raw input for a basis decision, not a return forecast.
Doing it by hand means reconciling funding intervals that differ per venue and per instrument, two unit conventions, and a filter for pairs where both order books are deep enough to trade. This package does that in one call.
- Intervals are read, not assumed. Hyperliquid funds hourly. Binance defaults to 8-hour funding, but 4-hour is common — of the 820 contracts it lists, 465 settle every 4 hours, 2 every hour — so the interval comes from
/fapi/v1/fundingInfoper symbol. OKX varies per instrument, so it is derived fromnextFundingTime − fundingTime. Assuming 8 hours everywhere halves the annualized figure on every 4-hour contract, with no visible error. - Both legs must be liquid. Open interest ≥ $1M and 24h volume ≥ $2M on Hyperliquid, plus 24h quote volume ≥ $2M on the benchmark venue. A pair that is deep on one side and empty on the other cannot be traded, however wide the gap looks.
- Dislocations are flagged, not promoted. Beyond 2,000 bps the row is marked
anomaly: trueand ranked after the ordinary rows. A gap that wide is usually one venue dislocating, not a carry you can hold. - It works from a blocked region. Binance answers HTTP 451 from US addresses, and Bybit's CDN refuses them too. The sensor tries Binance, falls back to OKX, and tells you which one it used in
benchmark.venue. Nothing to configure — it takes whichever responds. - The sensor module has zero dependencies. Native
fetch, nothing else, so it runs in Node 20+, in a serverless function, or on an edge runtime. The full package adds the x402 payment server on top.
Three ways to consume it. Locally, through the library or the MCP tool — free, and the only network calls are to the venue APIs. Remotely over HTTP, at two prices:
/fundingat $0.02 per call for the divergence itself, or/ultraat $0.25 per call to add measured execution capacity — how much size each gap actually carries. Same sensor underneath; Ultra adds order-book depth. See Use the hosted endpoint and Ultra.
Whether you use the free local package or the paid hosted endpoint, you never manage blockchain complexity: no RPC endpoint, no ETH, no KYC.
Install
Requires Node.js 20 or newer.
Integrate in two minutes
TypeScript. The package ships its own declarations — nothing to install, nothing to write by hand.
Any other language. The response validates against JSON Schema Draft 2020-12. The schema ships inside the package (schema/funding-divergence.schema.json), so you can generate a client from it instead of reading this page:
An agent (MCP). One entry in Claude Desktop, Cursor, or any MCP client:
Coinbase AgentKit. Coinbase's X402ActionProvider is built to call any x402-protected endpoint, and both prices here sit below its default 1.00 USDC per-request cap. It only calls services it knows about, so register the URL once:
That is the whole integration. Every field is documented under Response shape.
Only want the data? This package ships the full payment server along with its dependencies. If you just need the sensor, install
hyperliquid-binance-funding— same sensor file, same output, zero dependencies.
Use it as a library
Tune the floors when the defaults are too strict for your universe:
Use it as an MCP tool
Any MCP-compatible client can call the sensor directly. Add this to your client configuration:
The tool is exposed as get_funding_divergence and accepts an optional limit (1–50, default 5). An agent that speaks MCP gets funding divergence with no integration work and no payment setup.
Use the hosted endpoint (pay per call)
A hosted instance runs at https://x402-funding.onrender.com and is billed per request over x402, the HTTP-native payment protocol: the server answers 402 Payment Required, your client attaches a signed USDC authorization, the request completes.
- Prices:
/fundingis $0.02 per call,/ultrais $0.25 per call, both in USDC on Base. - Optional query parameters:
limit(1–50 on/funding, 1–20 on/ultra);capacityandfees_bpson/ultraonly. - No account, no key: the paying address is the only identity involved.
- Free diagnostics:
GET /healthfor liveness,GET /sourcesfor which benchmark venues that host can actually reach.
Zero configuration. Your agent needs no ETH and no exchange account.
Automatic payment. The x402 SDK signs the USDC payment and handles authentication in the background.
100% gasless. Coinbase, acting as facilitator, pays the network fee. You only pay the call price.
To your code this is an API call like any other: one request in, one JSON body out. No wallet UI, no signing prompt, no blockchain library to configure beyond the snippet below.
Client example, using the x402 SDK:
Ultra: what the gap can actually absorb
A divergence says the venues disagree. It does not say whether anyone can act on it. A 1,800 bps gap on a pair whose Hyperliquid book holds $15k is not the same opportunity as the same gap on an $8M book — and nothing in a funding feed tells you which one you are looking at.
GET /ultra — $0.25 per call — adds, for each pair:
How the number is computed — and the closed-form case that validates the solver — is in CAPACITY.md. The short version: each book is consumed level by level, the volume-weighted price of each leg is compared to its best quoted price, and the largest size whose two impacts still fit the budget is found by bisection. Depth beyond what a venue publishes is never extrapolated, and when the internal safety ceiling is hit the response says usd_lower_bound: true rather than presenting a bound as a measurement.
Query parameters: limit (1–20, default 5), capacity (1–10 rows measured, default 5), fees_bps (0–200, default 9.5).
One row from a live call, verbatim — every number in it can be recomputed from the others, which is the point:
Ultra is measurement, not advice. It never suggests a position size or an allocation: it publishes what the market can absorb and what entering costs. If no pair's book can be measured, the endpoint answers 502 instead of 200, so the facilitator cancels settlement and you are not charged for an empty answer.
Response shape
Each row:
Methodology
- Hyperliquid publishes funding hourly:
rate × 8760. - Binance defaults to 8-hour funding, but 465 of the 820 contracts it lists settle every 4 hours and 2 every hour. The interval is read per symbol, then
rate × (8760 / interval). - OKX publishes one rate per instrument. The interval is derived from the response, then the same formula.
- Divergence is
HL − benchmark, expressed in basis points. - A positive divergence means Hyperliquid funding is richer, so the carry shorts Hyperliquid and longs the venue named in
benchmark.venue. - Rows are sorted by absolute divergence, with anomalies placed after ordinary rows.
Both venues are public and unauthenticated. On the Binance path the sensor issues three parallel requests and returns in about 1.5 s. The OKX fallback costs one request per pair, so roughly 3.5 s for the liquid universe.
What this is not
The divergence is an instantaneous annualization, not a forecast. A funding rate that reads −200% annualized today can read +50% tomorrow, because the annualization multiplies whatever the last settlement was by 1,095 or 2,190. That is why every row carries stability: how much this pair's rate has actually moved over the recent window, and where it sat on average.
A gap of 3,000 bps does not mean a 30% annual return. It usually means one venue is briefly dislocated, which is exactly what anomaly is there to tell you.
Self-host it
The package ships the full server. Clone the repository, install, and point it at a receiving address:
GET /health and GET /sources are free. GET /funding and GET /ultra are the paid routes.
Mainnet requires CDP credentials because the public x402 facilitator serves testnets only. The server refuses to start on eip155:8453 without them rather than failing at the first payment.
The first 1,000 settlements each month are free; beyond that the facilitator charges $0.001 per settlement. That figure sets your floor for a viable per-call price.
Hosted vs. self-hosted: what you are actually paying for
Self-hosting costs nothing in money. It costs an afternoon of setup and a standing obligation to keep the service running. Both paths run the same two routes; only who receives the payment changes.
- Zero maintenance. No upstream API changes to track, no restarts, no CDP credentials to rotate.
- Always warm. The hosted instance runs continuously, so an agent loop never pays for a cold start. You configure no keep-alive job of your own.
- One line of code. No clone, no
.env, no full dependency install. Afetchcall is the whole integration.
Choose the hosted endpoint when this data is an input to something else you are building. Self-host when you need your own liquidity floors, your own receiving address, or a different network.
License
MIT
Built on public venue APIs. Funding rates change continuously; the numbers this package returns are a snapshot, not a forecast.
來源:README.md,提交 9f0c4ba
工具
0版本歷史
4- v1.5.0最新Nov 3, 2026
- v1.4.0Nov 1, 2026
- v1.2.0Oct 31, 2026
- v1.0.7Oct 31, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分