360 Secure SkillHub
360 安全技能中心

vike-perp-carry

该 Skill 通过 vike-data 命令行调用市场数据接口,提供跨场所永续合约 carry 筛选、资金费率历史和到期期货基差查询;输出包含费用、净收益、毛/净 APR、价差捕获与盈亏平衡小时等字段,并支持 JSON 或表格视图。

分类:数据
vikeio
vikeio
热度 38.28
最近更新 2026-12-02 09:58:10

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add vikeio/vike-perp-carry
兼容性
通用兼容
联网要求
需要联网
数据出网
必须出网
Metadata
name
vike-perp-carry
description
Cross-venue perp carry after costs. Long one leg on one venue and short the other on another (two perps, or spot bought against a perp shorted); each pair is scored by the funding it earns plus the price gap it captures, as gross and net APR, with fees, net dollars and break-even hours. Also the funding history that shows whether a funding gap lasts. Use when the user asks "is this funding arb worth it after fees" / "best carry trade right now" / "net APR of a cross-exchange perp trade" / "spot-perp carry" / "how long until it breaks even" / "has BTC funding on Binance been positive all week".
allowed-tools
Bash(vike-data:*)

vike-perp-carry

vike-data md reads the REST API /v1/marketdata (CEX perps, 1 credit a call). md carry is the carry screener, and its defaults return the list on vike.io/perp/carry. md funding is one symbol's funding history, for checking that a funding gap is more than one print. Pass the base asset (BTC, not BTCUSDT); venues are lower case.

Commands

vike-data md carry --json                                      # defaults: --legs all --direction funding --costs fees_slippage --horizon 48 --min-spread-pct 0 --sort net --limit 50
vike-data md carry --legs perp_spot --json                     # spot bought, perp shorted: earns the perp's funding
vike-data md carry --direction convergence --min-spread-pct 0.5 --json   # long the cheaper price, short the dearer
vike-data md carry --costs fees --fee-bps 5 --horizon 24 --json
vike-data md funding BTC --exchange binance --start 2026-11-23 --json   # one venue's settled funding since a date, newest first
vike-data md funding-now BTC --json                                     # every venue's funding now
  • --legs: all (the default), perp_perp (a perpetual on each of two venues) or perp_spot (spot bought and a perpetual shorted; spot is never shorted).
  • --direction: funding (the default: long the lower funding rate, short the higher) or convergence (long the cheaper price, short the dearer).
  • --costs: none (net equals gross), fees (taker fees, entry and exit on both legs) or fees_slippage (fees plus slippage on all four fills, the default).
  • --fee-bps (0-100) replaces every venue's own taker fee. It is refused with --costs none.
  • --slippage-bps (0-100, default 2) is accepted only with --costs fees_slippage.
  • --horizon is the holding period in hours (1-720, sent as horizon_h): funding accrues over it, and both APRs are annualised from it.
  • --min-spread-pct (0-25, default 0) is the smallest PRICE gap between the two legs, in percent, of either sign. It is not a funding spread.
  • Any flag the route does not take is a 400. A refusal exits 1 with the server's message.

Reading the answer

The envelope has as_of (unix seconds of the prices), the inputs as applied (legs and direction among them), notional_usd (1000) and rows. Each row has:

  • symbol, and for long_ and short_:
    • venue and market (perp or spot), price (mid);
    • funding_rate (one settlement), interval_h and interval_src, rate_8h, apr, capped, next_funding_ts. Every funding field is null on a spot leg.
  • spread_pct: the short leg's price over the long leg's, in percent. It is negative when the long leg is the dearer, which is common with --direction funding.
  • funding_spread_24h_pct: what the pair's funding earns in 24 hours.
  • spread_capture_usd (the gap, captured when prices meet; negative when it costs), net_funding_usd (over the horizon), fees_usd (the costs) and net_usd. All are for $1,000 on EACH leg.
  • gross_apr and net_apr, both fractions of the capital on both legs (0.25 = 25 % a year; 3.19 = 319 %).
  • breakeven_h: hours of funding needed to pay the costs the gap does not. 0 means the gap alone pays them; null means funding never does.
  • min_leg_vol_usd: only legs with $1M+ of 24-hour volume are listed. A pair whose perp leg has no current funding rate is left out.

What the funding-leg fields mean:

  • capped: true means that leg's rate sits at its venue's published cap or floor. The real pressure may be larger, and the rate can stay pinned there. null means the venue publishes no cap.

  • interval_src says where interval_h comes from: venue (the venue publishes it for the symbol), fixed (the venue settles hourly for every market) or default (nothing published, 8 h assumed). Treat a default leg's rate_8h and apr as an estimate.

  • market_status on a perp leg is delisting (the venue has set a date, delist_ts in unix seconds) or reduce_only (it takes only orders that close or reduce a position). It is null while the market trades normally and on a spot leg. Never present a row with such a leg as a trade: the position can be force-closed or cannot be opened.

  • In the table view (no --json):

    • a capped rate prints as 0.002 capped;
    • the interval prints as published, e.g. 4h, or 8h assumed for default;
    • a leg's venue with a status prints as binance (delisting 2026-12-08) or bybit (reduce_only).

    --json keeps the raw capped, interval_src, market_status and delist_ts fields.

Dated futures: the cash-and-carry basis

vike-data md basis BTC --json                    # every live dated BTC future, highest apr first; basis against the index
vike-data md basis ETH --ref spot --sort expiry --json

Each row in futures describes one contract:

  • exchange, instrument, expiry (unix seconds), days_to_expiry, type (linear or inverse) with contract_size;
  • price and price_src (book mid, else mark, else last);
  • index_price, spot_price, perp_price and ref_price (the one --ref picks);
  • basis = (price - ref_price) / ref_price, a fraction;
  • apr = basis x 365 / days_to_expiry, the yield of buying the underlying and selling the future to expiry, before fees. It is null under 2 days;
  • vol_24h_usd and oi_usd.

Covers binance (USDT-M and COIN-M), bybit, okx, deribit, gate and kraken. Unlike a funding carry, this yield is locked in at entry if held to expiry. A short horizon still inflates the APR, so quote basis next to it.

How to read it:

  • Lead with net_usd for the horizon and net_apr, not gross_apr. Say which --legs, --direction, --costs and --horizon you used.
  • A large APR on a short horizon is mostly a one-off gap capture annualised: a 2.6 % gap over 48 hours reads as hundreds of percent a year. It is not repeatable. Quote net_usd per $1,000 a leg next to it.
  • spread_capture_usd assumes the two prices meet within the horizon. If they do not, only net_funding_usd is earned, and the exit pays the costs.
  • Funding is the rate now, not a forecast. Run md funding <SYM> --exchange <venue> for each perp leg and check that the sign held over recent days. In those rows apr is also a fraction, and rate_8h puts 1h, 4h and 8h venues on one scale.

Anti-patterns

  • Don't present gross_apr as the return, and don't read an APR fraction as percent (0.25 is 25 %, not 0.25 %).
  • Don't compare rows fetched with different --legs, --direction, --costs or --horizon.
  • Don't extrapolate a capped leg's rate, or a leg with interval_src: default, without saying so.
  • Don't call a wide gap free money. Gaps above 25 % are dropped as ticker collisions, and a 2-25 % gap on a thin pair can be a different contract or a stale venue. Check min_leg_vol_usd and both prices.
  • Don't treat a row as risk-free: the two legs sit on two venues, each with its own margin, liquidation and transfer risk.
  • Don't extrapolate one funding print to a year without the history check above.

Pairs well with

  • vike-perp-funding for each venue's funding of one symbol and the pre-ranked funding-arbitrage list
  • vike-perp-overview for the widest price gaps, open interest and long/short
  • vike-perp-crowding to see whether the side you would short is crowded