perp-funding-basis
Fungsinya
Skill ini menjelaskan funding rate dan selisih basis pada futures perpetual kripto. Skill ini untuk trader yang ingin mengukur kepadatan pasar atau menguji carry trade.
Kapan dipakai
- โSaat Anda ingin tahu apakah trader di pasar kripto sangat banyak long atau short.
- โSaat funding rate pada kontrak perpetual menjadi sangat tinggi atau negatif secara tidak biasa.
- โSaat Anda membandingkan harga spot dengan harga futures untuk mencari carry trade.
Link skill
https://github.com/HKUDS/Vibe-Trading/blob/main/agent/src/skills/perp-funding-basis/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
โApakah funding rate perpetual Bitcoin sedang sangat tinggi saat ini, dan apa artinya?โ
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Skill ini mengubah funding rate menjadi angka tahunan dan membandingkan harga futures dengan harga spot. Funding positif yang tinggi menunjukkan posisi long yang padat, sedangkan funding negatif menunjukkan posisi short yang padat.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Perpetual Funding Rate & Basis Trading
Overview
Analyze perpetual futures funding rates and spot-futures basis to identify carry trade opportunities, market positioning extremes, and directional sentiment signals. Funding rates are the single most important microstructure indicator in crypto derivatives โ they reveal real-time leverage positioning and crowd sentiment.
Core Concepts
1. Funding Rate Mechanics
Perpetual futures have no expiry date. Instead, a funding rate is exchanged between longs and shorts every 8 hours (on most exchanges) to keep the perpetual price anchored to the spot price.
If perp price > spot price โ funding rate positive โ longs pay shorts
If perp price < spot price โ funding rate negative โ shorts pay longs
OKX funding rate schedule: payments at 00:00, 08:00, 16:00 UTC
Annualized funding rate:
# Funding rate is a per-8h DECIMAL, exactly as OKX/Binance return it
# (the API sends "0.0001" for 0.01%). 3 funding windows/day โ ร 3 ร 365.
funding_rate_8h = 0.0001 # 0.01% per 8h, as a decimal
annualized = funding_rate_8h * 3 * 365 # 0.1095 โ 10.95% annualized
Units convention (whole skill): all code treats the funding rate as a per-8h decimal (
0.0001= 0.01%), matching the raw OKX/Binance API value. The tables below show the equivalent percentages for readability โ divide a table's%by 100 to get the decimal a comparison expects (+0.05%โ0.0005).
2. Funding Rate Signal Framework
| Funding Rate (8h) | Annualized | Market State | Signal |
|---|---|---|---|
| > +0.05% | > +54.75% | Extreme long crowding | Contrarian short / reduce longs |
| +0.02% to +0.05% | +21.9% to +54.75% | Elevated long bias | Cautious, carry trade viable |
| +0.005% to +0.02% | +5.5% to +21.9% | Mild long bias | Neutral to mild bullish |
| -0.005% to +0.005% | -5.5% to +5.5% | Balanced | Neutral |
| -0.02% to -0.005% | -21.9% to -5.5% | Mild short bias | Neutral to mild bearish |
| < -0.02% | < -21.9% | Short squeeze territory | Contrarian long / reduce shorts |
Funding rate regime detection:
def funding_regime(rates_7d):
"""Classify funding rate regime from 7-day history."""
avg = sum(rates_7d) / len(rates_7d)
consecutive_positive = all(r > 0 for r in rates_7d[-3:])
consecutive_negative = all(r < 0 for r in rates_7d[-3:])
if avg > 0.0003 and consecutive_positive: # > +0.03% per 8h
return "overheated_long" # High risk of long squeeze
elif avg > 0.0001 and consecutive_positive: # > +0.01% per 8h
return "bullish_carry" # Good carry trade environment
elif avg < -0.0002 and consecutive_negative: # < -0.02% per 8h
return "overheated_short" # High risk of short squeeze
elif avg < -0.00005 and consecutive_negative: # < -0.005% per 8h
return "bearish_carry" # Inverse carry trade
else:
return "neutral"
3. Spot-Futures Basis Analysis
Basis = Futures price - Spot price
For dated futures (quarterly), basis reflects cost-of-carry expectations:
# Annualized basis
def annualized_basis(futures_price, spot_price, days_to_expiry):
basis_pct = (futures_price - spot_price) / spot_price
annualized = basis_pct * (365 / days_to_expiry)
return annualized
# Example: BTC spot $65,000, quarterly future $66,500, 45 days to expiry
# Basis: 2.31%, Annualized: 18.7%
Basis signal interpretation:
| Annualized Basis | Market State | Signal |
|---|---|---|
| > 30% | Extreme contango, euphoric leverage | Sell basis (cash-carry), top warning |
| 15-30% | Elevated contango, bullish leverage | Carry trade attractive |
| 5-15% | Normal contango | Neutral, mild bullish |
| 0-5% | Flat basis | Low conviction, wait for direction |
| < 0% (backwardation) | Bearish, forced selling | Contrarian long, extreme pessimism |
4. Cash-Carry Arbitrage (Delta-Neutral)
Strategy: buy spot + sell perpetual futures โ collect funding rate
# Cash-carry trade P&L
def carry_trade_pnl(spot_entry, funding_rates, position_size):
"""
Delta-neutral carry: long spot + short perp
P&L comes purely from funding rate collection.
"""
total_funding_collected = 0
for rate in funding_rates:
if rate > 0: # Longs pay shorts โ we collect as short
total_funding_collected += rate
Pertanyaan umum
Siapa yang membayar funding rate?
Saat funding positif, long membayar short. Saat negatif, short membayar long.
Seberapa sering funding dibayarkan?
Di sebagian besar bursa, termasuk OKX, funding dibayarkan setiap 8 jam.
Apa itu cash-and-carry trade?
Itu adalah membeli aset spot dan menjual futures untuk menangkap selisih basis, dan tetap membawa sejumlah risiko.
Detail
Deskripsi asli dari pembuat
Perpetual futures funding rate analysis and cash-carry basis trading โ funding rate regimes, annualized basis signals, carry trade construction, and funding rate arbitrage between exchanges.
repo: HKUDS/Vibe-Trading
Popularitas
- Bintang GitHub
- 37k
- Peringkat
- #7542
- Lisensi
- MIT
- Diperbarui
- 1/11/2026
Komentar
- โฆ
Skill lain dari repositori ini
vibe-trading
37kMemberi agent Anda perangkat riset keuangan lengkap, mencakup backtest, analisis faktor, penetapan harga opsi, dan data pasar di banyak pasar.
adr-hshare
37kMenunjukkan kepada agent Anda cara membandingkan harga perusahaan Tiongkok yang terdaftar di beberapa pasar, seperti ADR AS dan saham Hong Kong.
akshare
37kMemungkinkan agent Anda mengambil data pasar gratis untuk saham Tiongkok dan global, futures, forex, dan indikator ekonomi, tanpa perlu kunci API.
alpha-zoo
37kMemungkinkan agent Anda menelusuri pustaka faktor saham siap pakai dan menguji seberapa baik sekumpulan faktor itu memprediksi imbal hasil di pasar pilihan.
Skill serupa
gitcrawl
394kMemungkinkan agent Anda mencari arsip issue dan pull request GitHub yang tersimpan, mengelompokkan yang duplikat, dan memeriksa status terkininya di GitHub.
slacrawl
394kMemungkinkan agent Anda mencari dan menghitung pesan di arsip Slack lokal, memeriksa seberapa baru arsip itu, dan menyegarkannya bila diperlukan.
goplaces
394kMembantu agent Anda mencari tempat, mendapatkan detail dan ulasannya, serta menentukan nama tempat memakai Google Places, dengan keluaran JSON untuk skrip.