basis-arb

basis-arb is a skill for Claude Code from Superior-Trade/superior-skills. It costs 87 tokens per session (2,817 once invoked), scanned A, original, MIT.

A guide for using the difference between a cryptocurrency's spot price and its perpetual-futures price as a trading signal. It describes a long-perpetual strategy, not a fully hedged basis arbitrage, because Freqtrade cannot cleanly run both legs.

In plain words
What is it for?
Use it to build or assess strategies based on spot–perpetual price differences and funding rates, especially on Hyperliquid through Freqtrade.
Why use it?
It avoids presenting a one-leg trade as market-neutral arbitrage. The missing spot position means the trade can still carry directional market risk.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the superior-skills plugin — 31 skills shipped together

Good fit Use it to build or assess strategies based on spot–perpetual price differences and funding rates, especially on Hyperliquid through Freqtrade.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/superior-trade/superior-skills/basis-arb
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 Superior-Trade/superior-skills --skill basis-arb
Clone the repo
git clone --depth 1 https://github.com/Superior-Trade/superior-skills

Made for: Claude Code.

Or install superior-skills, the plugin that ships this one along with the rest of its 31 skills.

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 basis-arb

README.md
[![agentmods](https://agentmods.dev/badge/skills/superior-trade/superior-skills/basis-arb/github.svg)](https://agentmods.dev/skills/superior-trade/superior-skills/basis-arb)
Your own site
<a href="https://agentmods.dev/skills/superior-trade/superior-skills/basis-arb"><img src="https://agentmods.dev/badge/skills/superior-trade/superior-skills/basis-arb/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 basis-arb

Your own site · 80×15
<a href="https://agentmods.dev/skills/superior-trade/superior-skills/basis-arb"><img src="https://agentmods.dev/badge/skills/superior-trade/superior-skills/basis-arb.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 87 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,817 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found 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.00087 $0.02817
Opus 5 $0.00044 $0.01409
Sonnet 5 $0.00017 $0.00563
Haiku 4.5 $0.00009 $0.00282

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

Security

Grade A, and why

basis-arb 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.

skills/basis-arb/SKILL.md · 219 lines

How it starts

The opening of the file, as written. The whole thing — 219 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Strategy: Basis Flipping — Directional (Long-Perp Leg)

Honest framing — read this first

True basis arbitrage is a two-leg trade:

  • Long perp + short spot (when perp trades at a discount to spot, basis < 0)
  • Short perp + long spot (when perp trades at a premium, basis > 0)

You earn the basis as the legs converge. Freqtrade is a single-leg engine — it can't run paired hedged trades on the same ticker. The strategy below captures the directional signal that "basis flipping negative + funding negative = bullish positioning shift" and goes long the perp accordingly. It's a momentum read on positioning, not a hedged arb.

If you want the actual hedged version, run an external system (or a custom Hyperliquid-only multi-leg runtime). Don't deploy this template thinking it's market-neutral.

Backtest reference

Window BTC/USDC:USDC 1h, 2026-01-01 → 2026-05-01
Trades 0 (no spot leg available in the engine)
Backtest ID 01kr42hegps9w20njsty2cqb41

The Superior Trade backtest engine doesn't currently expose Hyperliquid spot OHLCV alongside perp pairs via Freqtrade's informative_pairs mechanism, so the spot_close column is never populated and the entry filter never fires. The strategy code is structurally sound — it runs cleanly to completion with 0 trades — but this template can't be validated end-to-end on the current backtest engine. Two paths:

  1. Validate live, paper-traded — run as a dry-run deployment for a week and compare the entries against an external basis tracker (CoinGlass basisHistory or a simple notebook).
  2. Substitute external basis feed — replace the informative_pairs spot fetch with a CoinGlass /api/futures/basis/history call from a side-channel cache. Out of scope for this template; would be a Phase 2 backend change.

The strategy is shipped as a directional blueprint, not a live-validated runtime. Treat it as a teachable template for how to wire spot-perp basis into a Freqtrade strategy, rather than an off-the-shelf deployment.

Read the full file on GitHub · 219 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 · 219 lines · 87 tokens per session scan A 911c6fff66dd

Subscribe to this mod's changes

basis-arb is a skill published in the GitHub repository Superior-Trade/superior-skills (209 stars, last pushed yesterday), licensed MIT. It adds 87 tokens to every session and 2,817 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.