A new trading strategy framework for decentralised exchanges

The Trading Strategy protocol has created new Python-based trade and algorithmic strategy execution framework for decentralised exchanges.


In the past, the Trading Strategy protocol used Python-based Backtrader and QSTrader algorithmic trading frameworks to trade on decentralised exchanges. These frameworks had been originally designed with stock trading in mind. Furthermore, both of these projects are no longer maintained. Due to the specialised nature of decentralised markets, these frameworks could not sufficiently work for live trading or complex strategy scenarios.

Trading Strategy's new trade execution framework

We have been working for the last six months on a new trade execution framework that is built from the ground up to support decentralised exchanges and decentralised finance services. The new framework takes inspiration from its predecessors, but also includes flexibility making it suitable for on-chain trading.

The framework focuses on directional trading strategies, unlike high-frequency trading (HFT), miner extractable value (MEV) and passive yield farming strategies you often see with decentralised finance.

An example of a strategy backtest using interactive Plotly chart output. See the notebook for full details.

The features include, but are not limited to:

The trade execution framework is built with the latest software development best practices in mind to maximize the developer productivity and ease of use, making it suitable for professional developers and quant funds. Both Python and JavaScript integrations are supported.

Technical analysis features

The trade execution framework uses open source pandas_ta library for technical analysis, indicators, statistics and performance calculations.

Currently, it supports over 100 functions. All the indicators are documented.

See documentation for more than 100 technical indicators

Low-level blockchain integration

The trade execution framework integrates EVM-compatible blockchains using the open source Web3-Ethereum-Defi Python library. The development of Web3-Ethereum-Defi was sponsored by a Uniswap grant.

An example of the Uniswap v3 concentrated liquidity price analysis using web3-ethereum-defi high performance EVM event reader

Web3-Ethereum-Defi features include but are not limited to

Strategy and code examples

Although the current release is an early beta, there are some backtesting examples available in the documentation.

A trade timeline analysis with position coloring by its profit

Next steps

Try the code examples in the documentation and start playing with backtests. more releases coming in the upcoming weeks, enabling more DEXes, and integrations like Enzyme Protocol and Aave.

Trading Strategy is hiring. If you have experience with quant finance, data research or Python SQLAlchemy backends please contact us at [email protected].

Trading Strategy is an algorithmic trading protocol for decentralised markets, enabling automated trading on decentralised exchanges (DEXs). Learn more about algorithmic trading here.

Join our community of traders and developers on Discord.