jeremylongshore/tons-of-skills-marketplace / plugins/crypto/crypto-derivatives-tracker/skills/tracking-crypto-derivatives
tracking-crypto-derivatives
VerifiedResearch crypto perpetual swaps, dated futures and options from live public exchange data: funding rates, open interest, basis, liquidations, put/call ratios and max pain. Read-only, no API keys. Use when checking funding across exchanges, comparing open interest, reading the futures term structure, reviewing recent liquidations, or summarizing the options market for BTC or ETH. Trigger with phrases like "funding rate", "open interest", "perpetual swap", "futures basis", "liquidations", "put call ratio", "max pain", "derivatives analysis", or "BTC perps".
| File | Kind | Size |
|---|---|---|
| ARD.md | markdown | 2.7 KB |
| PRD.md | markdown | 2.7 KB |
| SKILL.md | skill md | 6.9 KB |
| assets/demo-recording.json | config | 187.6 KB |
| references/errors.md | markdown | 2.5 KB |
| references/examples.md | markdown | 17.4 KB |
| references/implementation.md | markdown | 4.8 KB |
| scripts/basis_data.py | script | 4.5 KB |
| scripts/derivatives_tracker.py | script | 25.0 KB |
| scripts/http_client.py | script | 6.4 KB |
| scripts/liquidations.py | script | 4.0 KB |
| scripts/options_data.py | script | 9.2 KB |
| scripts/perps.py | script | 17.6 KB |
| scripts/record_demo.py | script | 3.3 KB |
| tests/fixtures/binance-bybit-recording.json | config | 12.8 KB |
| tests/test_derivatives_tracker.py | script | 10.0 KB |
references/implementation.md
View on GitHub# Implementation Reference
## Design
- **Public data only.** Every request is an unauthenticated GET (plus Hyperliquid's public `info` POST). There is no order, account, withdrawal or signing code; `tests/` checks that.
- **No invented values.** A venue that errors, refuses the connection or does not list the coin appears under "Unavailable" with the reason. Summaries use only the venues that answered.
- **Standard library only.** `urllib` for HTTP, a thread pool to query venues in parallel.
- **Recorded data is labelled.** `--demo` replays `assets/demo-recording.json`, a recording of real responses, through the same parsers. Every console line starts with `[DEMO]` and JSON carries `"mode": "demo"`.
## Modules
| File | Role |
|------|------|
| `scripts/http_client.py` | Requests, plain-language failure reasons, recording and replay, one clock per run |
| `scripts/perps.py` | Per-venue funding and open interest adapters, 24h history, account ratios, funding summary |
| `scripts/basis_data.py` | Dated-futures basis from Deribit and OKX |
| `scripts/liquidations.py` | OKX filled liquidation orders, paged back over the look-back window |
| `scripts/options_data.py` | Deribit option summaries, max pain, ATM IV, DVOL, large trades |
| `scripts/derivatives_tracker.py` | Command line, console tables, JSON envelope |
| `scripts/record_demo.py` | Maintainer tool that refreshes the demo recording |
## Units and formulas
**Funding.** Each venue's `funding_rate` is the rate for one of its own funding intervals, as a fraction.
- 8-hour equivalent = `funding_rate × 8 / interval_hours`
- Simple annual rate = `funding_rate × (8760 / interval_hours) × 100`%
- Open-interest-weighted mean uses each venue's one-sided open interest in USD as the weight.
**Open interest** is counted on one side (the number of open contracts, not longs plus shorts), converted to coins, then to USD at the venue's mark or index price. The 24-hour change compares coin amounts an hour apart 24 hours back, so price moves do not affect it.
**Basis** = `(futures price / index - 1) × 100`%, using the same venue's index. Annualized = `basis × 365 / days to expiry` (simple). Futures within 12 hours of expiry are omitted because annualizing them amplifies noise.
**Max pain** for an expiry is the strike at which `Σ call OI × max(S − K, 0) + Σ put OI × max(K − S, 0)` is smallest.
**ATM IV** is Deribit's mark IV at the strike nearest the expiry's underlying price (call and put averaged).
**DVOL rank** = `(current − 365-day low) / (365-day high − 365-day low)`; **percentile** = share of the past 365 daily closes below the current value.
## Venue field mapping
| Venue | Instrument | Funding field, interval | Open interest field |
|-------|-----------|-------------------------|---------------------|
| OKX | `{COIN}-USDT-SWAP` | `fundingRate`, interval from `nextFundingTime − fundingTime` (8h) | `oiCcy` (coins) |
| Deribit | `BTC-PERPETUAL`, `ETH-PERPETUAL`, else `{COIN}_USDC-PERPETUAL` | `funding_8h` (accrues continuously) | `open_interest`: USD for inverse perpetuals, coins for USDC perpetuals |
| Hyperliquid | `{COIN}` | `funding`, hourly | `openInterest` (coins) |
| Kraken Futures | `PF_{COIN}USD` (BTC is `XBT`) | `relativeFundingRate`, hourly | `openInterest` (contract size one coin) |
| KuCoin Futures | `{COIN}USDTM` (BTC is `XBT`) | `fundingFeeRate`, `currentFundingRateGranularity` (8h) | `openInterest × multiplier` |
| Gate | `{COIN}_USDT` | `funding_rate`, `funding_interval` (8h) | `position_size × quanto_multiplier` (total long side) |
| dYdX | `{COIN}-USD` | `nextFundingRate`, hourly | `openInterest` (coins) |
| Binance | `{COIN}USDT` | `lastFundingRate`, interval from `fundingInfo` (8h default) | `openInterest` (coins) |
| Bybit | `{COIN}USDT` | `fundingRate`, `fundingIntervalHour` | `singleOpenInterest` (`openInterest` counts both sides) |
Hourly funding intervals for Hyperliquid, Kraken and dYdX were confirmed from each venue's funding-history timestamps on 2026-10-25.
## Not covered, on purpose
- **Liquidation heatmaps.** Vendors estimate where positions would be liquidated from models; public exchange data cannot reproduce that, so no heatmap is drawn.
- **Simulated options flow.** Only real recent trades (`--large-trades`) are shown.
- **Liquidations outside OKX.** Other venues in this set publish liquidations only over websockets or not at all. The report says it is OKX only.
- **BitMEX.** It refuses connections from both the US and the EU networks tested, so it was removed.
- **Interpretation as advice.** Output describes conditions; it does not recommend trades.
## Refreshing the demo recording
```bash
cd scripts && python3 record_demo.py
```
This runs every command for BTC through one recording client, trims the large Deribit payloads to the fields and expiries the demo displays, and rewrites `assets/demo-recording.json`. Run the tests afterwards.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| add-product-e2e-evalpaperclipai/paperclipAdd or extend a Paperclip full-stack runner E2E workflow, fixture, matcher, or report evidence path for local or Daytona execution. | Stars: 115k | Updated | Claude CodeCodex | Verified | Install |
| add-runner-evalpaperclipai/paperclipAdd or extend a Paperclip Runner protocol evaluation definition, roster, assertion, or report fixture with provenance and narrow validation. | Stars: 115k | Updated | Claude CodeCodex | Verified | Install |
| diagnose-why-work-stoppedpaperclipai/paperclipCompatibility entry point for failed, stalled, looping, or over-recovered Paperclip work. Use fix-failed-paperclip-run for the full diagnosis, regression, repair, real verification, and green-PR workflow; honor an explicitly requested diagnosis-only scope. | Stars: 115k | Updated | Claude CodeCodex | Verified | Install |
| fix-failed-paperclip-runpaperclipai/paperclipDiagnose and fix failed, stuck, slow, or incorrectly blocked Paperclip tasks and runs. Use with a task/run URL or failure report to trace the root cause, prove a regression red then green, check second-order effects, verify the real workflow, and deliver a PR with passing checks. | Stars: 115k | Updated | Claude CodeCodex | Verified | Install |