Repolode
tradingstrategy-ai

tradingstrategy-ai/trading-strategy

Python framework for backtesting and live trading algorithmic strategies on decentralised exchanges, with on-chain market data.

Stars
383
Forks
63
Open issues
10
Last commit
11 days ago

Repolode describes open-source projects and does not give investment advice. Trading and investing can lose money: assess the risk yourself and follow the laws where you live before using this project.

What is it?

Trading Strategy is a Python framework for algorithmic trading on decentralised exchanges (DEXes). It provides data fetching for downloading DeFi market data sets, which can be used both for backtesting strategies and for live trading.

Strategies are typically developed and backtested in Jupyter Notebook. The framework covers blockchains such as Ethereum, Binance Smart Chain and Polygon, and reads trading data from DEXes including SushiSwap, QuickSwap and PancakeSwap. Price feeds come from the Trading Strategy Protocol.

The core `trading-strategy` package handles data only; executing automated trades requires the separate trade-executor package. The project also covers deploying strategies as smart contract vaults that users can invest in with their wallets.

Key features

  • 01Downloads decentralised finance market data sets for backtesting and live trading.
  • 02Supports Ethereum, Binance Smart Chain and Polygon.
  • 03Reads trading data from DEXes such as SushiSwap, QuickSwap and PancakeSwap.
  • 04Integrates with Jupyter Notebook for strategy development and data analysis.
  • 05Supports deploying strategies as smart contract vaults.

Use cases

  • Analysing investment opportunities on decentralised exchanges.
  • Building and backtesting trading algorithms that trade on DEXes.
  • Publishing a trading strategy as an on-chain vault that users can invest in.

Quick start

  1. 1

    Install the package with pip (with direct-feed extra)

    pip install "trading-strategy[direct-feed]"
  2. 2

    Follow the Getting Started repository and documentation for first steps

Things to know

  • Requires Python 3.10.
  • The trading-strategy package only provides data download; automated trading needs the separate trade-executor package.
  • Licensed under AGPL-3.0, a copyleft license with network-use obligations.

Topics

FAQ

What is trading-strategy?
Python framework for backtesting and live trading algorithmic strategies on decentralised exchanges, with on-chain market data. Trading Strategy is a Python framework for algorithmic trading on decentralised exchanges (DEXes). It provides data fetching for downloading DeFi market data sets, which can be used both for backtesting strategies and for live trading.
Is trading-strategy free to use? What license does it have?
trading-strategy is open source under the Other license. Check the license terms before using it in commercial products.
Is trading-strategy still maintained?
Actively maintained. The last commit to trading-strategy was on Oct 28, 2026.
What can I use trading-strategy for?
Analysing investment opportunities on decentralised exchanges. Building and backtesting trading algorithms that trade on DEXes. Publishing a trading strategy as an on-chain vault that users can invest in.
How do I install trading-strategy?
Install the package with pip (with direct-feed extra): pip install "trading-strategy[direct-feed]" Follow the Getting Started repository and documentation for first steps
Where can I get trading-strategy?
The source code and installation instructions are on GitHub: https://github.com/tradingstrategy-ai/trading-strategy

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects