# Perp Funding Basis

Perpetual futures funding rate analysis and cash-carry basis trading, funding rate...

- Repository: https://github.com/HKUDS/Vibe-Trading (37375 stars)
- Category: Engineering
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add HKUDS/Vibe-Trading --skill perp-funding-basis -g -a claude-code -y`
Codex: `npx skills add HKUDS/Vibe-Trading --skill perp-funding-basis -g -a codex -y`
Cursor: `npx skills add HKUDS/Vibe-Trading --skill perp-funding-basis -g -a cursor -y`
Gemini CLI: `npx skills add HKUDS/Vibe-Trading --skill perp-funding-basis -g -a gemini-cli -y`

## Description

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.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 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:**
```python
# 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

The rest: https://github.com/HKUDS/Vibe-Trading/blob/HEAD/agent/src/skills/perp-funding-basis/SKILL.md
