When to use
Use this skill when you are:
- Backtesting an existing strategy from
wayfinder_paths/strategies/
- Validating a new trading strategy idea before production deployment
- Analyzing historical performance (Sharpe, drawdown, CAGR, funding PnL)
- Testing any strategy type: momentum, delta-neutral, yield rotation, carry trade
- Testing different leverage levels or parameter combinations
How to use
First, determine if you're backtesting an existing strategy or a new idea:
Backtesting an existing strategy (from wayfinder_paths/strategies/)
Load these rules:
- rules/backtesting.md — Always load first. Config reference, stats format, gotchas.
- rules/existing-strategies.md — REQUIRED for existing strategies. Workflow for reading strategy source code, extracting parameters, fetching real Delta Lab data, and faithfully reproducing signal logic. Never use generic helpers with default parameters for existing strategies.
- Load the strategy-type-specific rule if applicable (yield-strategies.md).
Backtesting a new strategy idea
Load these rules in order (most to least specific for your strategy type):
rules/backtesting.md — Strategy type → helper mapping, quick start examples, config reference, stats format, gotchas, production path. Always load this first.
rules/yield-strategies.md — Detailed patterns for lending/yield strategies: supply rate rotation, leveraged yield loops, carry trade, multi-venue benchmark. Load when the user's strategy involves lending protocols, supply APRs, or borrow rates.
Examples
- examples/basic_momentum.py — Cross-sectional momentum using
quick_backtest
- examples/delta_neutral.py — Delta-neutral basis carry using
backtest_delta_neutral
- examples/yield_rotation.py — USDC rotation across lending venues using
backtest_yield_rotation
- examples/carry_trade.py — Borrow cheap / supply expensive using
backtest_carry_trade
Strategy type → helper cheat sheet
| Strategy |
One-liner |
| Momentum/trend (perp) |
quick_backtest(strategy_fn, symbols, start, end) |
| Delta-neutral basis carry |
backtest_delta_neutral(symbols, start, end) |
| Yield rotation (lending) |
backtest_yield_rotation(symbol, venues, start, end) |
| Carry trade (borrow/supply spread) |
backtest_carry_trade(symbol, start, end) |
| Active perps / HIP-3 (deployable) |
backtest_perps_trigger(signal_fn, decide_fn, symbols, ...) |
| Full control |
run_backtest(prices, target_positions, config) |
All helpers are in wayfinder_paths.core.backtesting.
For actively-traded Hyperliquid strategies (perp or HIP-3), use backtest_perps_trigger and the trigger pattern. The same signal.py and decide.py modules run in backtest, live, and reconcile — drift is architecturally impossible. See rules/perps-trigger.md.
1---2name: backtest-strategy3description: Guide agents through backtesting strategy ideas with automatic data fetching and performance analysis4---56## When to use78Use this skill when you are:9- Backtesting an existing strategy from `wayfinder_paths/strategies/`10- Validating a new trading strategy idea before production deployment11- Analyzing historical performance (Sharpe, drawdown, CAGR, funding PnL)12- Testing any strategy type: momentum, delta-neutral, yield rotation, carry trade13- Testing different leverage levels or parameter combinations1415## How to use1617**First, determine if you're backtesting an existing strategy or a new idea:**1819### Backtesting an existing strategy (from `wayfinder_paths/strategies/`)2021Load these rules:22231. **[rules/backtesting.md](rules/backtesting.md)** — **Always load first.** Config reference, stats format, gotchas.242. **[rules/existing-strategies.md](rules/existing-strategies.md)** — **REQUIRED for existing strategies.** Workflow for reading strategy source code, extracting parameters, fetching real Delta Lab data, and faithfully reproducing signal logic. Never use generic helpers with default parameters for existing strategies.253. Load the strategy-type-specific rule if applicable (yield-strategies.md).2627### Backtesting a new strategy idea2829Load these rules in order (most to least specific for your strategy type):30311. **[rules/backtesting.md](rules/backtesting.md)** — Strategy type → helper mapping, quick start examples, config reference, stats format, gotchas, production path. **Always load this first.**32332. **[rules/yield-strategies.md](rules/yield-strategies.md)** — Detailed patterns for lending/yield strategies: supply rate rotation, leveraged yield loops, carry trade, multi-venue benchmark. Load when the user's strategy involves lending protocols, supply APRs, or borrow rates.3435## Examples3637- [examples/basic_momentum.py](examples/basic_momentum.py) — Cross-sectional momentum using `quick_backtest`38- [examples/delta_neutral.py](examples/delta_neutral.py) — Delta-neutral basis carry using `backtest_delta_neutral`39- [examples/yield_rotation.py](examples/yield_rotation.py) — USDC rotation across lending venues using `backtest_yield_rotation`40- [examples/carry_trade.py](examples/carry_trade.py) — Borrow cheap / supply expensive using `backtest_carry_trade`4142## Strategy type → helper cheat sheet4344| Strategy | One-liner |45|---|---|46| Momentum/trend (perp) | `quick_backtest(strategy_fn, symbols, start, end)` |47| Delta-neutral basis carry | `backtest_delta_neutral(symbols, start, end)` |48| Yield rotation (lending) | `backtest_yield_rotation(symbol, venues, start, end)` |49| Carry trade (borrow/supply spread) | `backtest_carry_trade(symbol, start, end)` |50| Active perps / HIP-3 (deployable) | `backtest_perps_trigger(signal_fn, decide_fn, symbols, ...)` |51| Full control | `run_backtest(prices, target_positions, config)` |5253All helpers are in `wayfinder_paths.core.backtesting`.5455> **For actively-traded Hyperliquid strategies (perp or HIP-3), use `backtest_perps_trigger` and the trigger pattern.** The same `signal.py` and `decide.py` modules run in backtest, live, and reconcile — drift is architecturally impossible. See [rules/perps-trigger.md](rules/perps-trigger.md).