perp-funding-basis

perp-funding-basis is a skill for Claude Code, Codex from skloxo/TideTrading. It costs 42 tokens per session (2,739 once invoked), scanned A, a copy of perp-funding-basis, MIT.

A framework for analysing funding payments on perpetual futures, which are futures contracts without an expiry date, and the price gap between futures and spot markets. It also covers carry trades, where positions are designed to collect that difference or the funding payments.

In plain words
What is it for?
Use it to study funding-rate regimes, annualised basis signals, positioning sentiment, carry-trade construction, and funding arbitrage between exchanges.
Why use it?
Perpetual futures can trade above or below the actual asset price, while funding payments show which side of the market is more heavily positioned. This helps identify those pricing gaps, payment conditions, and possible sentiment extremes.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit Use it to study funding-rate regimes, annualised basis signals, positioning sentiment, carry-trade construction, and funding arbitrage between exchanges.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/skloxo/tidetrading/perp-funding-basis
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add skloxo/TideTrading --skill perp-funding-basis
Clone the repo
git clone --depth 1 https://github.com/skloxo/TideTrading

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for perp-funding-basis

README.md
[![agentmods](https://agentmods.dev/badge/skills/skloxo/tidetrading/perp-funding-basis/github.svg)](https://agentmods.dev/skills/skloxo/tidetrading/perp-funding-basis)
Your own site
<a href="https://agentmods.dev/skills/skloxo/tidetrading/perp-funding-basis"><img src="https://agentmods.dev/badge/skills/skloxo/tidetrading/perp-funding-basis/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for perp-funding-basis

Your own site · 80×15
<a href="https://agentmods.dev/skills/skloxo/tidetrading/perp-funding-basis"><img src="https://agentmods.dev/badge/skills/skloxo/tidetrading/perp-funding-basis.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,739 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 89% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00042 $0.02739
Opus 5 $0.00021 $0.01370
Sonnet 5 $0.00008 $0.00548
Haiku 4.5 $0.00004 $0.00274

Measured 11d ago against content hash 1f44994e6267, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

perp-funding-basis scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

89% identical to perp-funding-basis — 44 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

agent/src/skills/perp-funding-basis/SKILL.md · 253 lines

How it starts

The opening of the file, as written. The whole thing — 253 lines — stays where its author put it; the contents beside it link to each section on 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:

# OKX funding rate is per 8-hour period
# Annualized = rate × 3 (per day) × 365
funding_rate_8h = 0.01  # 0.01% per 8h
annualized = funding_rate_8h * 3 * 365  # = 10.95% annualized

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.03 and consecutive_positive:
        return "overheated_long"       # High risk of long squeeze
    elif avg > 0.01 and consecutive_positive:
        return "bullish_carry"          # Good carry trade environment
    elif avg < -0.02 and consecutive_negative:
        return "overheated_short"       # High risk of short squeeze
    elif avg < -0.005 and consecutive_negative:
        return "bearish_carry"          # Inverse carry trade
    else:
        return "neutral"

Read the full file on GitHub · 253 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 253 lines · 42 tokens per session scan A 1f44994e6267

Subscribe to this mod's changes

perp-funding-basis is a skill published in the GitHub repository skloxo/TideTrading (10 stars, last pushed 4d ago), licensed MIT. It adds 42 tokens to every session and 2,739 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It is 89% identical to perp-funding-basis, differing in 44 lines, and is treated as a copy.

Related

Other skills, from other repositories

daily-deep-brief

A scheduled, pre-market investment briefing for Hong Kong and United States stocks. A deterministic preparation step gathers data and an agent adds judgment, while a later step validates and publishes the result.

KCNyu/clawock · 163 tokens

hk-stock-analysis

A workspace-aware analysis workflow for Hong Kong-listed stocks. It retrieves prices, technical indicators, market comparisons, and news through a local data pipeline, then adds Hong Kong-specific investment context.

KCNyu/clawock · 126 tokens

us-stock-analysis

Workspace-aware US stock analysis for kcn. Routes through clawock analyze-us / clawock us-quotes instead of generic web search, then layers fundamental/technical/news analysis on top. Use when user asks to analyze a US ticker (e.g. "analyze AAPL", "look at RKLB", "compare TSLA vs NVDA"), check earnings, run…

KCNyu/clawock · 97 tokens

portfolio-swarm-review

Multi-agent swarm review of kcn's current holdings. Inspired by TauricResearch/TradingAgents framework already in workspace — three-tier analysis (analysts → bull/bear debate → risk debate + judge) with confidence scoring. Use for post-close reviews, holiday/next-session planning, pre-add sizing decisions, and any…

KCNyu/clawock · 90 tokens

invest-analyst

A framework for producing professional investment research, including company reports, industry studies, event analysis, analyst-expectation reviews, comparisons, and market summaries. It connects several investment research workflows into one process.

taxueseek/fund-investment-guide · 193 tokens

invest-fund

A Chinese-language guide for analysing investment funds, with different workflows for comparing funds, reviewing ETFs, examining new funds, and studying industry funds.

taxueseek/fund-investment-guide · 142 tokens