Install any skill in seconds. Free to start, no credit card required.
Get Started Free →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.
.claude/skills/superior-trade-funding-rate-arbitrage/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 5% | 0% |
| case-02 | ✗→✓ | ▲ Improved | -18% | 0% |
| case-03 | ✗→✓ | ▲ Improved | -10% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 103% | 0% |
| case-14 | ✗→✓ | ▲ Improved | 26% | 0% |
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:
pythonfunding = 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.
pythonfrom 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
json{ "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. |
can_short = True, enter_short when funding_apr > 0.30, exit_short when funding_apr <= 0.0. Profitable when alts are paying high positive funding (squeezes).StaticPairList with VolumePairList filtered to top 20 perps. Loop the same logic per pair. PnL compounds.BTC/USDC returns no funding rate — the column will be all zeros and zero trades fire. Always use BTC/USDC:USDC.dp.get_pair_dataframe(candle_type="funding_rate") is wired up for HL. Other exchanges may return empty.try/except plus the dataframe.empty check matters — if funding history isn't downloaded yet, the strategy must not crash. The reference above handles both.funding_rate is per-hour (HL funds hourly). Annualizing as * 365 instead of * 24 * 365 is off by 24×.docs/standard-strategies-audit.md, backtest 01kqyz3ejgy5b7tdemhb6gj9nf| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-04 | pass→pass | 32,921 | 17,111 | -48% | 1 | 1 | 0% | 4,863 | 5,191 | +7% | 0 | 0 | — |
case-01 | fail→pass | 43,750 | 13,339 | -70% | 1 | 1 | 0% | 4,768 | 4,985 | +5% | 0 | 0 | — |
case-02 | fail→pass | 41,459 | 14,980 | -64% | 1 | 1 | 0% | 6,284 | 5,172 | -18% | 0 | 0 | — |
case-03 | fail→pass | 27,573 | 16,602 | -40% | 1 | 1 | 0% | 5,205 | 4,703 | -10% | 0 | 0 | — |
case-05 | pass→pass | 31,225 | 27,337 | -12% | 1 | 1 | 0% | 4,313 | 7,132 | +65% | 0 | 0 | — |
case-06 | pass→pass | 28,152 | 23,892 | -15% | 1 | 1 | 0% | 4,055 | 6,800 | +68% | 0 | 0 | — |
case-07 | fail→pass | 10,436 | 7,211 | -31% | 1 | 1 | 0% | 1,586 | 3,221 | +103% | 0 | 0 | — |
case-08 | pass→pass | 9,027 | 9,214 | +2% | 1 | 1 | 0% | 1,783 | 3,565 | +100% | 0 | 0 | — |
case-09 | pass→pass | 8,966 | 6,435 | -28% | 1 | 1 | 0% | 1,478 | 3,220 | +118% | 0 | 0 | — |
case-10 | pass→pass | 17,466 | 12,882 | -26% | 1 | 1 | 0% | 2,730 | 4,057 | +49% | 0 | 0 | — |
case-11 | pass→pass | 17,931 | 7,603 | -58% | 1 | 1 | 0% | 2,428 | 3,382 | +39% | 0 | 0 | — |
case-12 | pass→pass | 11,397 | 5,724 | -50% | 1 | 1 | 0% | 1,865 | 3,062 | +64% | 0 | 0 | — |
case-13 | pass→pass | 34,351 | 15,030 | -56% | 1 | 1 | 0% | 2,892 | 4,290 | +48% | 0 | 0 | — |
case-14 | fail→pass | 14,913 | 4,556 | -69% | 1 | 1 | 0% | 2,198 | 2,775 | +26% | 0 | 0 | — |
case-15 | pass→pass | 21,715 | 16,410 | -24% | 1 | 1 | 0% | 3,071 | 5,089 | +66% | 0 | 0 | — |
case-16 | fail→pass | 34,963 | 14,977 | -57% | 1 | 1 | 0% | 3,317 | 5,040 | +52% | 0 | 0 | — |
case-17 | fail→pass | 10,794 | 5,199 | -52% | 1 | 1 | 0% | 1,436 | 2,818 | +96% | 0 | 0 | — |
case-18 | fail→pass | 15,126 | 12,707 | -16% | 1 | 1 | 0% | 2,467 | 4,282 | +74% | 0 | 0 | — |
case-19 | pass→pass | 16,586 | 6,787 | -59% | 1 | 1 | 0% | 2,251 | 3,076 | +37% | 0 | 0 | — |
case-20 | pass→pass | 14,911 | 7,908 | -47% | 1 | 1 | 0% | 1,599 | 3,282 | +105% | 0 | 0 | — |
case-21 | pass→pass | 12,772 | 16,173 | +27% | 1 | 1 | 0% | 1,712 | 3,923 | +129% | 0 | 0 | — |
case-22 | fail→pass | 13,904 | 5,702 | -59% | 1 | 1 | 0% | 2,431 | 3,107 | +28% | 0 | 0 | — |
case-23 | fail→pass | 31,181 | 13,624 | -56% | 1 | 1 | 0% | 2,902 | 4,105 | +41% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +43 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.