360 Secure SkillHub
360 安全技能中心

perp-basis-scanner

这是一款加密币期现基差研究监控工具,无需API密钥,免费调用Binance、Bybit等4家交易所公开接口,对比现货与永续合约的基差、年化基差估算及资金费率。支持单次扫描(输出表格/JSON)和定时监控模式,输入为加密币符号等参数,输出多交易所数据,帮助交易者、研究员判断套利机会,仅作参考,不执行订单。

ssidharhubble
ssidharhubble
热度 13.35
最近更新 2026-08-16 12:02:05
分类:数据依赖:代码执行 / 第三方 API应用场景:市场分析 / 数据处理 / 财务 / 研究

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add perp-basis-scanner
Metadata
name
perp-basis-scanner
description
Scans the spot-vs-perpetual futures basis (contango/backwardation) across Binance, Bybit, OKX, and Deribit for any symbol they list, using free public REST market-data endpoints with no API key required. Useful for crypto trading, basis trade, cash-and-carry arbitrage, funding rate arbitrage, perpetual futures, options and derivatives research, whale-style institutional strategies, and passive income via delta-neutral spot-perp spreads. Reports live spot price, perp mark price, basis percentage, a rough annualized basis estimate, and the current 8-hour funding rate side by side across exchanges so you can spot the widest, most tradeable dislocations. Supports one-shot scans and a repeating watch mode for monitoring basis drift over time. Built for python developers, ai agent operators, and defi/crypto researchers who want a quick cross-exchange basis check before sizing a cash-and-carry or funding-rate-arbitrage position.
compatibility
Created for Zo Computer
metadata
{"author":"ssyopros.zo.computer"}

Perp Basis Scanner

Compares spot and perpetual futures prices across Binance, Bybit, OKX, and Deribit for a given symbol, reporting the basis (spread between spot and perp) and an approximate annualized rate. This is a research/monitoring tool, not an execution engine — it does not place orders.

When to use this skill

  • The user wants to check whether a spot-vs-perp basis trade (cash-and-carry) looks attractive right now for a given coin.
  • The user asks "what's the basis on BTC/ETH/SOL across exchanges" or wants to compare funding rates and mark-price spreads side by side.
  • The user wants a lightweight, repeatable way to watch basis drift over a session (watch mode).

How to run it

python3 scripts/basis_scanner.py scan BTC ETH SOL
python3 scripts/basis_scanner.py scan BTC --json
python3 scripts/basis_scanner.py scan BTC --exchanges binance,deribit
python3 scripts/basis_scanner.py watch BTC ETH --interval 30

scan runs once and prints a table (or JSON with --json). watch repeats the scan on an interval (seconds) until interrupted with Ctrl+C.

What it covers

  • Binance: spot /api/v3/ticker/price + futures /fapi/v1/premiumIndex (mark price + last funding rate).
  • Bybit: v5 /market/tickers for both spot and linear categories.
  • OKX: /market/ticker for spot and -SWAP instruments, plus /public/funding-rate.
  • Deribit: /public/get_index_price (spot index) + /public/ticker for the -PERPETUAL instrument (BTC/ETH/SOL only — Deribit doesn't list perpetuals for every coin).

Limitations

  • The "annualized basis" figure is a rough extrapolation (basis_pct * 3 * 365), not a real funding-payment forecast — actual funding rates float and can flip sign.
  • No order-book depth is used, so this does not account for slippage on entry/exit.
  • Deribit only supports BTC, ETH, and SOL perpetuals; other symbols will return an error row for that exchange and can be excluded with --exchanges.
  • All endpoints are public and unauthenticated; if an exchange rate-limits or blocks the request, that row will show an error field instead of failing the whole scan.