TIKTAPE
TikTape Learn

How do I backtest a Hyperliquid strategy in Freqtrade with more than 5,000 candles?

Freqtrade cannot download Hyperliquid history, so write three feather files to user_data/data/hyperliquid/futures/: candles for your timeframe, 1h candles (the mark price) and 1h funding rates. A script fills them from TikTape and Hyperliquid's fundingHistory; we ran it with Freqtrade 2026.11.

Short answer

freqtrade download-data cannot fetch Hyperliquid history, so write the files yourself: the candles for your timeframe, a 1h candle file (Freqtrade uses Hyperliquid's 1h futures candles as the mark price) and a 1h funding-rate file, all as feather in user_data/data/hyperliquid/futures/. Then freqtrade backtesting runs over as many months as you have candles. The script below takes the candles from TikTape and the funding rates from Hyperliquid's free fundingHistory.

What Freqtrade expects

File (pair BTC/USDC:USDC)ColumnsWhy
BTC_USDC_USDC-5m-futures.featherdate, open, high, low, close, volumeThe strategy timeframe
BTC_USDC_USDC-1h-futures.featherSameMark price: Freqtrade's Hyperliquid class sets mark_ohlcv_price to futures. Without it backtesting stops with No data found. Terminating.
BTC_USDC_USDC-1h-funding_rate.featherdate, funding_rateFunding fees on open positions

date must be a UTC datetime column, not integer milliseconds. Sources: Freqtrade data download, Freqtrade exchange notes ("downloading data is not possible" for Hyperliquid), and freqtrade/exchange/hyperliquid.py and data/history/datahandlers/idatahandler.py in the Freqtrade source.

Script: write the three files

import os, pathlib, time
import pandas as pd
import requests

KEY = os.environ["TIKTAPE_API_KEY"]
OUT = pathlib.Path("user_data/data/hyperliquid/futures")
STEP_MS = {"1m": 60_000, "5m": 300_000, "15m": 900_000, "1h": 3_600_000}

def candles(coin, interval, start_ms, end_ms):
    """OHLCV from TikTape, 10,000 candles per request."""
    rows, cursor = [], start_ms
    while cursor < end_ms:
        stop = min(end_ms, cursor + 10_000 * STEP_MS[interval])
        r = requests.get("https://tiktape.xyz/api/v1/ohlcv", headers={"X-API-Key": KEY}, timeout=60,
                         params={"coin": coin, "interval": interval, "startTime": cursor, "endTime": stop, "limit": 10_000})
        r.raise_for_status()
        rows += r.json()["data"]
        cursor = stop
    df = pd.DataFrame(rows, columns=["date", "open", "high", "low", "close", "volume"])
    df["date"] = pd.to_datetime(df["date"], unit="ms", utc=True)
    return df.astype({c: "float64" for c in ["open", "high", "low", "close", "volume"]})

def funding(coin, start_ms, end_ms):
    """Hourly funding from Hyperliquid's free fundingHistory, 500 rows per call."""
    rows = []
    while start_ms < end_ms:
        page = requests.post("https://api.hyperliquid.xyz/info", timeout=30, json={
            "type": "fundingHistory", "coin": coin, "startTime": start_ms, "endTime": end_ms}).json()
        rows += page
        if len(page) < 500:
            break
        start_ms = page[-1]["time"] + 1
        time.sleep(0.2)
    df = pd.DataFrame({"date": pd.to_datetime([r["time"] for r in rows], unit="ms", utc=True).floor("h"),
                       "funding_rate": [float(r["fundingRate"]) for r in rows]})
    return df.drop_duplicates("date")

coin, pair = "BTC", "BTC_USDC_USDC"  # Freqtrade pair BTC/USDC:USDC
start = int(pd.Timestamp("2025-10-01", tz="UTC").timestamp() * 1000)
end = int(pd.Timestamp("2025-11-01", tz="UTC").timestamp() * 1000)

OUT.mkdir(parents=True, exist_ok=True)
candles(coin, "5m", start, end).to_feather(OUT / f"{pair}-5m-futures.feather")
candles(coin, "1h", start, end).to_feather(OUT / f"{pair}-1h-futures.feather")  # mark price
funding(coin, start, end).to_feather(OUT / f"{pair}-1h-funding_rate.feather")

Run the backtest

Use a futures config with "trading_mode": "futures", "margin_mode": "isolated", "stake_currency": "USDC" and "exchange": {"name": "hyperliquid", "pair_whitelist": ["BTC/USDC:USDC"]}, then:

freqtrade backtesting -c config.json --strategy MyStrategy --timeframe 5m --timerange 20251001-20251101

We ran exactly this with Freqtrade 2026.11 on 2026-12-03: it loaded 30 days of 5m candles, and the trades carried funding fees from the funding file. For a longer test, widen start and end; one TikTape request returns about 35 days of 5m candles. Why the built-in download stops at 5,000 candles is covered in CCXT and Freqtrade history.

TikTape at a glance

Price
Full history: $19/month or $189/year; monthly starts with 1 month free (card required, cancel anytime). One-time candle packs from $7. 60 requests/min, up to 10,000 candles per request. Free no-signup sample: a week of BTC/ETH 1m candles as CSV.
Coverage
800+ Hyperliquid markets (perps, spot and HIP-3), 15 intervals from 1m to 1M. Perp and spot candles from 2025-03-23 at every interval; 1d, 3d, 1w and 1M back to each market's first Hyperliquid candle (BTC and ETH from 2020-08-19), 4h from 2024-08-13; HIP-3 markets from their listing. Candles from 2025-03-23 are built from Hyperliquid's S3 trade archives and live API; earlier candles are Hyperliquid's own candleSnapshot candles, not rebuilt from trades.
Quickstart
  1. Get a key at https://tiktape.xyz/#pricing (1 month free, then $19/mo; key emailed after checkout).
  2. Fetch candles (each row is [timestamp_ms, open, high, low, close, volume]):
    export TIKTAPE_API_KEY=your_key
    curl -H "X-API-Key: $TIKTAPE_API_KEY" \
      "https://tiktape.xyz/api/v1/ohlcv?coin=BTC&interval=1h&limit=24"
  3. Page backwards with endTime for older history. Full contract: https://tiktape.xyz/openapi.yaml.

Get the full Hyperliquid candle history

One TikTape key reads every market and interval past Hyperliquid's 5,000-candle limit, up to 10,000 candles per request. The monthly plan starts with 1 month free, then USD 19/month; a card is required and you can cancel anytime before the first charge.

Start the 1-month free trial