aerodrome
Use when creating, validating, backtesting, deploying, sizing, or troubleshooting Aerodrome/Base spot trading strategies through…
Use when writing a funding-rate-driven perp strategy on Superior Trade — anything described as funding harvest, funding arbitrage, funding rate carry, negative funding, paid to long, paid to short, basis trade. The strategy reads Hyperliquid hourly funding via
$ npx -y skills add Superior-Trade/superior-skills --skill funding-rate-arbitrage --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/funding-rate-arbitrageContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when writing a funding-rate-driven perp strategy on Superior Trade — anything described as funding harvest, funding arbitrage, funding rate carry, negative funding, paid to long, paid to short, basis trade. The strategy reads Hyperliquid hourly funding via
name: funding-rate-arbitrage description: Use when writing a funding-rate-driven perp strategy on Superior Trade — anything described as funding harvest, funding arbitrage, funding rate carry, negative funding, paid to long, paid to short, basis trade. The strategy reads Hyperliquid hourly funding via `dp.get_pair_dataframe(candle_type="funding_rate")`, which is automatically downloaded for backtests. metadata: version: 0.1.0 updated: 2026-05-07
A user wants to capture funding payments by being on the side that gets paid:
This is the most profitable of the six standard templates in our audit and the engine supports it natively. **Promote this template** when a user asks "what's a strategy that actually works?".
| Window | `BTC/USDC:USDC` 1h, 2026-01-01 → 2026-05-01 (BTC −13% over the window) | |---|---| | Trades | **55** | | Win rate | **58.2%** | | Wallet PnL | **+1.38% / +$13.76** | | Profit factor | 1.57 | | Sharpe | **1.52** | | Max drawdown | 0.58% | | Avg holding | 9h 40m | | Backtest ID | `01kqyz3ejgy5b7tdemhb6gj9nf` |
**~+4% APR on a single pair** through a market that fell 13%. A multi-pair scan (e.g. top 20 perps) compounds this.
The DataProvider exposes funding-rate candles directly. **No Hyperliquid REST call from inside the strategy is needed** for backtest — Freqtrade auto-downloads funding history when it sees a `candle_type="funding_rate"` request:
funding = self.dp.get_pair_dataframe(
pair=metadata["pair"],
timeframe="1h", # Hyperliquid funds hourly
candle_type="funding_rate",
)The returned dataframe has the same shape as OHLCV — `date`, `open`, `high`, `low`, `close`, `volume` — but `open` is the funding rate at the start of that hour, expressed as a fraction (`-0.0000135` = -0.0014% per hour). Annualize as `funding_rate * 24 * 365`.
The naive v1 (placeholder column filled with 0.0) produced **0 trades**. v2 with `dp.get_pair_dataframe(...)` produced 55 trades and Sharpe 1.52.
from freqtrade.strategy import IStrategy
from datetime import datetime
import pandas as pd
import talib.abstract as ta
class FundingHarvestStrategy(IStrategy):
minimal_roi = {"0": 100.0} # let funding work; no profit-target exit
stoploss = -0.05
trailing_stop = False
timeframe = "1h"
process_only_new_candles = True
startup_candle_count = 30
can_short = False
def populate_indicators(self, dataframe: pd.DataFrame, metadata: dict) -> pd.DataFrame:
# Hyperliquid funds hourly — request 1h funding-rate candles.
try:
funding = self.dp.get_pair_dataframe(
pair=metadata["pair"],
timeframe="1h",
candle_type="funding_rate",
)
except Exception:
funding = pd.DataFrame()
if not funding.empty and "open" in funding.columns:
f = funding[["date", "open"]].rename(columns={"open": "funding_rate"}).copy()
dataframe = dataframe.merge(f, on="date", how="left")
dataframe["funding_rate"] = dataframe["funding_rate"].ffill().fillna(0.0)
# Annualize hourly funding: APR = rate * 24 * 365.
dataframe["funding_apr"] = dataframe["funding_rate"] * 24 * 365
else:
dataframe["funding_rate"] = 0.0
dataframe["funding_apr"] = 0.0
dataframe["atr_24"] = ta.ATR(dataframe, timeperiod=24)
return dataframe
def populate_entry_trend(self, dataframe: pd.DataFrame, metadata: dict) -> pd.DataFrame:
# Long when funding APR is deeply negative (shorts paying longs).
dataframe.loc[
(dataframe["funding_apr"] < -0.10) & (dataframe["volume"] > 0),
"enter_long",
] = 1
return dataframe
def populate_exit_trend(self, dataframe: pd.DataFrame, metadata: dict) -> pd.DataFrame:
# Exit when funding flips back to non-negative (no more carry).
dataframe.loc[(dataframe["funding_apr"] >= 0.0), "exit_long"] = 1
return dataframe
def custom_exit(self, pair: str, trade, current_time: datetime,
current_rate: float, current_profit: float, **kwargs):
# Hard timeout — the entry condition was wrong if we're still in
# after 24h without an exit signal.
elapsed_h = (current_time - trade.open_date_utc).total_seconds() / 3600.0
if elapsed_h >= 24:
return "timeout_24h"
return None{
"exchange": { "name": "hyperliquid", "pair_whitelist": ["BTC/USDC:USDC"] },
"stake_currency": "USDC",
"stake_amount": 100,
"timeframe": "1h",
"max_open_trades": 1,
"stoploss": -0.05,
"minimal_roi": { "0": 100.0 },
"trading_mode": "futures",
"margin_mode": "cross",
"entry_pricing": { "price_side": "same" },
"exit_pricing": { "price_side": "same" },
"pairlists": [{ "method": "StaticPairList" }]
}**Pair format must be `<COIN>/USDC:USDC`** (futures). `BTC/USDC` (spot) won't have funding rate data.
| Knob | Effect | |---|---| | `-0.10` (entry threshold APR) | Stricter (`-0.20`) → fewer trades, only the deepest negative funding episodes. Looser (`-0.05`) → more trades, lower edge per trade. | | `>= 0.0` (exit threshold) | Stricter (`>= -0.05`) → exit before funding fully normalizes, lock more carry. | | `stoploss` | Funding pays slowly. A tight stop (`-0.02`) gets shaken out by routine volatility. `-0.05` is the sweet spot from the audit. | | `timeout_24h` | Max holding. Funding episodes typically last 4–12h on majors; 24h is a safety net. |
Trading strategies and intelligence tools for Superior Trade — natural-language strategy authoring, backtesting, and autonomous deployment on Hyperliquid, Lighter, and Polymarket.
Use when creating, validating, backtesting, deploying, sizing, or troubleshooting Aerodrome/Base spot trading strategies through…
Use when running, interpreting, or designing backtests on Superior Trade — anything about backtest windows, trade-count…
Use when the user asks for spot-perp basis trade, basis arbitrage, cash-and-carry, perp discount, or any setup that reads the…
Use when writing a symmetric Bollinger-band mean-reversion strategy on the 4h timeframe — BB reverter, range trader, chop…
Use when writing a swing/intraday breakout strategy on Superior Trade — anything described as breakout, momentum, trend…
Use when a Polymarket prediction-market thesis rests on an external event — CPI, Fed, elections, court rulings, ETF decisions —…