kraken-basis-trading

Capture the spot-futures price spread with delta-neutral basis trades.

23 stars

Best use case

kraken-basis-trading is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Capture the spot-futures price spread with delta-neutral basis trades.

Teams using kraken-basis-trading should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/kraken-official-basis-trading/SKILL.md --create-dirs "https://raw.githubusercontent.com/jiayaoqijia/cryptoskill/main/skills/exchanges/kraken-official-basis-trading/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/kraken-official-basis-trading/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How kraken-basis-trading Compares

Feature / Agentkraken-basis-tradingStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Capture the spot-futures price spread with delta-neutral basis trades.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# kraken-basis-trading

Use this skill for:
- identifying positive basis (futures premium over spot)
- entering delta-neutral positions (long spot, short futures)
- monitoring basis convergence
- closing both legs when basis narrows or contracts expire

## Core Concept

When futures trade at a premium to spot (positive basis), you can buy spot and sell futures for the same notional amount. The profit comes from basis convergence as the contract approaches expiry, or from collecting funding on perpetuals. The position is market-neutral: price movement does not affect P&L, only the spread does.

## Basis Calculation

```bash
SPOT=$(kraken ticker BTCUSD -o json 2>/dev/null | jq -r '.[].c[0]')
FUTURES=$(kraken futures ticker PF_XBTUSD -o json 2>/dev/null | jq -r '.ticker.last')
BASIS=$(echo "scale=4; ($FUTURES - $SPOT) / $SPOT * 100" | bc)
echo "Basis: ${BASIS}%"
```

A positive basis means futures are more expensive than spot (contango). A negative basis means futures are cheaper (backwardation).

## Entry (Long Spot + Short Futures)

1. Check spot price and futures price.
2. Ensure the basis is attractive (e.g., > 0.5% annualized).
3. Calculate matched position sizes.
4. Execute both legs (requires human approval):

```bash
# Long spot
kraken order buy BTCUSD 0.01 --type limit --price $SPOT -o json 2>/dev/null

# Short futures (matched notional)
kraken futures order sell PF_XBTUSD 1 --type limit --price $FUTURES -o json 2>/dev/null
```

## Monitoring

Watch basis convergence:

```bash
# Periodic check
kraken ticker BTCUSD -o json 2>/dev/null
kraken futures ticker PF_XBTUSD -o json 2>/dev/null
```

Check positions:

```bash
kraken balance -o json 2>/dev/null
kraken futures positions -o json 2>/dev/null
```

## Exit

Close both legs when basis narrows to target:

```bash
# Sell spot
kraken order sell BTCUSD 0.01 --type market -o json 2>/dev/null

# Close futures short
kraken futures order buy PF_XBTUSD 1 --reduce-only -o json 2>/dev/null
```

## Risk Considerations

- **Execution risk**: legs may fill at different times. The basis can move between fills.
- **Funding risk**: on perpetuals, negative funding rates mean the short pays the long, eating into profit.
- **Margin risk**: a sharp spot rally increases margin requirement on the short futures leg.
- **Leg risk**: if one leg fails to fill, the position is directional, not neutral.

## Hard Rules

- Never enter a basis trade without confirming both legs will execute.
- Monitor futures margin continuously; a large spot rally can trigger liquidation on the short.
- Close both legs together; leaving one open converts to a directional bet.
- Requires human approval for all live entries and exits.

Related Skills

margin-trading

23
from jiayaoqijia/cryptoskill

KuCoin Margin trading using the KuCoin API. Cross margin and isolated margin market data, order queries, borrowing/repaying queries, lending queries, and risk limits. Authentication requires API Key, API Secret, and Passphrase.

futures-trading

23
from jiayaoqijia/cryptoskill

KuCoin Futures trading using the KuCoin API. Futures market data, orders, positions, and funding fees. Authentication requires API Key, API Secret, and Passphrase.

Kraken Crypto Skill

23
from jiayaoqijia/cryptoskill

Use the kraken_cli.py wrapper to query your Kraken account.

openclaw_kraken

23
from jiayaoqijia/cryptoskill

Use a Bash CLI to query Kraken Spot and Futures APIs, inspect account state, run guarded trading and funding actions, and work with Kraken websocket payloads using OpenClaw-managed secrets.

kraken-ws-streaming

23
from jiayaoqijia/cryptoskill

Real-time data streaming via WebSocket for spot and futures.

kraken-twap-execution

23
from jiayaoqijia/cryptoskill

Execute large orders as time-weighted slices to reduce market impact.

kraken-tax-export

23
from jiayaoqijia/cryptoskill

Export trade history, ledgers, and cost basis data for tax reporting.

kraken-subaccount-ops

23
from jiayaoqijia/cryptoskill

Create and manage subaccounts with inter-account transfers.

kraken-stop-take-profit

23
from jiayaoqijia/cryptoskill

Manage stop-loss and take-profit orders for risk-bounded positions.

kraken-spot-execution

23
from jiayaoqijia/cryptoskill

Execute spot orders with validation, confirmation gates, and post-trade checks.

kraken-shared

23
from jiayaoqijia/cryptoskill

Shared runtime contract for kraken-cli: auth, invocation, parsing, and safety.

kraken-risk-operations

23
from jiayaoqijia/cryptoskill

Operational risk controls for live agent trading sessions.