6DuckLearn Skills

funding rate scanner

One-click scan of all USDT margin perpetual contracts, sorted by funding rate from negative to positive, automatically calculating 8-hour returns, daily returns, and annualized returns (including leverage conversion). Cross-exchange comparison mode synchronously pulls public data from OKX and Binance, identifying arbitrage windows where the rate difference between the two exchanges exceeds 0.05%—going long on the exchange with a more negative rate and shorting on the exchange with a higher rate, allowing profit from the spread without directional judgment.

trading-strategy Tags: okx, trading, community, okx-marketplace, trading-strategy, strategy

6DuckLearn provenance: Community skill by LaNaka, mirrored from the OKX Skills Marketplace (https://www.okx.com/en-sg/agent-tradekit/skills/funding-rate-scanner). It is not curated, verified, or endorsed by 6DuckLearn or represented as an official OKX publication.

Financial safety boundary: Never request secrets in chat. Before any external API call or action that places, cancels, or amends an order; changes leverage; transfers funds; creates or stops a bot; subscribes to or redeems an earn product; or signs/broadcasts a transaction, show the exact live/demo profile, instrument, side, size, price constraints, fees, and worst-case loss, then obtain explicit user approval. Default to read-only or demo mode when uncertain. Treat all analysis as research, not investment advice.

Funding Rate Scanner

Scan perpetual futures funding rates to find high-yield arbitrage opportunities. Uses OKX as the primary data source via OKX Trade Kit (CLI first, MCP fallback), with Binance data for cross-exchange comparison via bundled scripts.

Data Source Roles

  • OKX Trade Kit (CLI/MCP) — primary source for real-time OKX funding rates, tickers, open interest, and candles
  • scripts/scan.js — bulk-scans all Binance USDT-margined perps; use for cross-exchange comparison
  • scripts/analyze.js — single-coin historical funding rate analysis on Binance
  • scripts/monitor.js — watchlist monitor for specific coins on Binance

Workflow

Step 1 — Fetch OKX Funding Rate (CLI First)

CLI (primary):

okx market funding-rate BTC-USDT-SWAP
okx market ticker BTC-USDT-SWAP

MCP fallback (if CLI unavailable):

  • market_get_funding_rate(instId="BTC-USDT-SWAP") — current rate and next settlement time
  • market_get_ticker(instId="BTC-USDT-SWAP") — price, volume, bid/ask

Step 2 — Scan All OKX Instruments

To scan all USDT-margined perpetual swaps on OKX, fetch each instrument's funding rate via CLI or MCP. Start by listing all SWAP instruments:

okx market instruments --instType SWAP

Then loop through and fetch funding rates for each. Filter to instruments where |rate| > 0.01% to surface meaningful opportunities.

Step 3 — Binance Cross-Exchange Data

For cross-exchange comparison, use the bundled scripts (Node.js required):

# Scan all Binance perps — returns top negative and positive rates
node ${CLAUDE_SKILL_DIR}/scripts/scan.js

# Detailed history for a specific coin
node ${CLAUDE_SKILL_DIR}/scripts/analyze.js DUSK

# Monitor a specific watchlist
node ${CLAUDE_SKILL_DIR}/scripts/monitor.js DUSK DASH AXS

These scripts query Binance public APIs directly — no API key needed.

Step 4 — Rank and Analyze

For each instrument, compute:

Field Formula
Funding Rate Raw rate from exchange
Daily Return rate × 3 (assumes 8h settlement — see note below)
Annualized Return rate × 3 × 365
Leveraged Annual annualized × leverage

Settlement period note: The rate × 3 formula assumes 8-hour settlement (standard for most OKX and Binance perps). Some OKX instruments settle every 4h or 1h — check fundingTime and nextFundingTime in the API response to confirm, and adjust the multiplier accordingly.

Sort by most negative rate (best long opportunity) or highest positive rate (best short opportunity).

Step 5 — Cross-Exchange Comparison

When both OKX and Binance rates are available, identify discrepancies:

Coin     OKX Rate    Binance Rate   Delta    Opportunity
DUSK     -0.25%      -0.38%         0.13%    Long Binance / Short OKX
AXS      -0.10%      -0.12%         0.02%    Marginal

A delta >0.05% between exchanges signals a potential cross-exchange funding arbitrage opportunity. Before acting on it, factor in:

  • Transfer and withdrawal fees between exchanges
  • Margin requirements on both sides
  • Execution risk if rates shift before positions are opened

Step 6 — Historical Analysis

For deeper analysis on a specific instrument:

CLI (primary):

okx market candles BTC-USDT-SWAP --bar 1H --limit 24
okx market open-interest BTC-USDT-SWAP

MCP fallback:

  • market_get_candles(instId="BTC-USDT-SWAP", bar="1H", limit=24)
  • market_get_open_interest(instId="BTC-USDT-SWAP", instType="SWAP")

For Binance historical funding rate data, use:

node ${CLAUDE_SKILL_DIR}/scripts/analyze.js COIN

Step 7 — Monitor Watchlist

To track specific instruments at regular intervals:

# Binance watchlist
node ${CLAUDE_SKILL_DIR}/scripts/monitor.js DUSK DASH AXS

# OKX watchlist via CLI
for inst in DUSK-USDT-SWAP DASH-USDT-SWAP AXS-USDT-SWAP; do
  echo "--- $inst ---"
  okx market funding-rate "$inst"
done

Output Format

=== Funding Rate Opportunities (OKX) ===

Rank  Coin    Rate      Annual(5x)   Volume     Next Settlement
1     DUSK    -0.38%    2071%        $30M       03:00 UTC (2h)
2     AXS     -0.12%    655%         $46M       03:00 UTC (2h)
3     DASH    -0.12%    649%         $50M       03:00 UTC (2h)

=== Cross-Exchange Comparison (OKX vs Binance) ===

Coin    OKX       Binance   Delta
DUSK    -0.25%    -0.38%    0.13%  ← arbitrage candidate
AXS     -0.10%    -0.12%    0.02%  marginal

Strategy Notes

Negative funding rate means shorts pay longs every settlement period.

  1. Open a long position on a coin with a deeply negative funding rate
  2. Collect funding payments every 8 hours (or per settlement period)
  3. Set a stop-loss to limit directional downside
  4. For delta-neutral exposure: hedge with a spot short or inverse position on another exchange

Risk Warning: Funding rates change frequently and can flip within hours. High leverage amplifies both gains and losses. Cross-exchange arbitrage carries execution and transfer risk. Always use stop-loss orders. Only risk capital you can afford to lose.

Error Handling

  • If OKX CLI is unavailable, fall back to MCP tools (market_get_funding_rate, etc.)
  • If MCP tools are unavailable, fall back to Binance scripts for all data
  • If a symbol is invalid, report the error and suggest valid OKX SWAP format (e.g., BTC-USDT-SWAP)
  • If the API times out, retry once, then report the failure with the last known data if available
  • If no negative rates are found, report that all rates are positive and suggest setting a monitoring interval

Related skills

  • ahr999 btc hodl — The BTC smart investment assistant based on the Nine Gods Index (AHR999) spans bull and bear markets. It automatically retrieves on-chain valuation data, investing when undervalued and pausing when overvalued, using objective indicators to replace subjective emotions. It supports two strategies: fixed amount and AHR999 tiered variable amounts, which are executed fully automatically once set.
  • bb momentum breakout — Bollinger Band squeeze breakout + MACD confirmed momentum trading Skill. Use this skill when users say 'Bollinger breakout', 'momentum breakout', 'BB breakout', or 'activate breakout strategy'. Automatically detects directional breakouts after Bollinger Band squeezes, combining MACD signals and ATR dynamic stop-loss to quickly enter and exit to capture momentum trades.
  • btc naked k breakout — BTC naked K structure AI breakout strategy. Triggered every 5 minutes, it identifies structural points based on 300 candlesticks, builds a box, evaluates structural quality, and executes breakout pullback trades through comprehensive AI judgment, supporting dynamic position sizing and advanced position management.
  • btc trader — Trading skills focused on BTC-USDT trends/volatility/crowding, testing profits of 500 USDT. Used to generate structured market setup indicators, making decisions on opening positions/watching/ skipping based on EMA20/EMA60, RSI14, ATR14, funding rates, and changes in open interest. By default, it is a signal version and does not place orders automatically; it only enters the order and stop-loss process when the user explicitly requests execution and the execution tool is available.
  • crypto swing signal analyst — Cryptocurrency swing analysis skills based on EMA20, EMA60, RSI14, MACD, and ATR14, used to determine trends, identify long and short opportunities, and provide stop-loss, take-profit, and risk recommendations.
  • dca bot parameterizer — Don't make impulsive trades; use a data-driven six-step workflow to accurately set parameters for your OKX Martingale bot. Automatically pull real-time market data through the OKX Trade Kit, using EMA20 to determine trend status, ATR% to measure volatility, and structural analysis to anchor support/resistance, covering all scenarios including spot and futures (with leverage recommendations, hard cap of 4x). The core highlight is the safety gate mechanism: under strong trend conditions, it actively warns and refuses execution, automatically switching to defense mode after forced confirmation, reducing the initial amount, widening the step size, and lowering the multiplier.