auto-researchtrading  by Nunchi-trade

AI framework for autonomous trading strategy discovery

Created 1 month ago
681 stars

Top 49.5% on SourcePulse

GitHubView on GitHub
Project Summary

This project provides an autonomous system for researching and discovering high-performance trading strategies for perpetual futures on Hyperliquid. It targets engineers, researchers, and power users seeking to automate strategy development, offering a significant performance uplift (7.9x Sharpe ratio improvement) through AI-driven, zero-human-intervention experimentation.

How It Works

The system adapts Karpathy's autoresearch pattern, where an AI agent autonomously modifies a single file (strategy.py). Each modification is backtested against historical Hyperliquid perpetual futures data, and only improvements are retained. Strategies are scored based on a formula combining Sharpe ratio, trade count, maximum drawdown, and turnover. The core design emphasizes iterative refinement, with each successful commit to strategy.py representing an atomic experiment, and the Git history serving as a comprehensive log. The final discovered strategy is a 6-signal ensemble leveraging majority voting.

Quick Start & Requirements

  • Primary install: Requires Python 3.10+ and uv (a fast Python package manager, installable via curl -LsSf https://astral.sh/uv/install.sh | sh).
  • Prerequisites: No API keys are required. Data is fetched from public CryptoCompare and Hyperliquid APIs.
  • Setup:
    1. git clone https://github.com/Nunchi-trade/auto-researchtrading.git
    2. cd auto-researchtrading
    3. uv run prepare.py (downloads data, ~1 min, cached to ~/.cache/autotrader/data/)
  • Run a Backtest: uv run backtest.py
  • Dependencies: numpy, pandas, scipy, requests, pyarrow, and standard library.
  • Links: Agent CLI, Docs (docs.nunchi.trade), Research (research.nunchi.trade).

Highlighted Details

  • Achieved a Sharpe ratio of 20.634 with a 0.3% maximum drawdown over 103 fully autonomous experiments, a 7.9x improvement over the baseline momentum strategy (Sharpe 2.724).
  • The final strategy is a 6-signal ensemble (Momentum, Very-short momentum, EMA crossover, RSI(8), MACD, BB compression) requiring a 4/6 majority vote for execution.
  • A key finding is "Simplicity Wins," with the most significant gains coming from removing complexity like pyramiding, funding boosts, and correlation filters.
  • The system enforces strict rules: only strategy.py can be edited, no new dependencies can be added, and each backtest has a 120-second time budget.

Maintenance & Community

  • Community channels include Discord (discord.gg/nunchi) and X (@nunchi).
  • The project is built upon Karpathy's autoresearch pattern and utilizes data from CryptoCompare and Hyperliquid.

Licensing & Compatibility

  • License: MIT License.
  • Compatibility: The MIT license permits commercial use and linking within closed-source projects.

Limitations & Caveats

The system is designed for autonomous modification of only strategy.py; altering core scripts like prepare.py or backtest.py is prohibited. The autonomous loop is intended to be driven by an LLM agent (e.g., Claude Code with the /autoresearch skill).

Health Check
Last Commit

4 days ago

Responsiveness

Inactive

Pull Requests (30d)
3
Issues (30d)
6
Star History
691 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.