TradeByte is a modular crypto trading bot platform built exclusively for Kraken, designed to help traders navigate volatile markets and seize rare opportunities. Whether you're backtesting strategies or executing live trades, TradeByte brings together strategy deployment, data analysis, and performance tracking in one flexible, streamlined system—built for serious crypto traders.
Together, Python and Rust combine to deliver a flexible yet powerful framework that supports both high-level strategy development and low-level system performance.
Black Swan is a modular trading strategy manager designed for flexibility, performance, and extensibility. It allows users to create custom trading strategies, backtest them on historical data, paper trade in real-time without risking capital, and transition seamlessly into live trading. The platform also provides detailed analytics and performance statistics to help users evaluate and refine their strategies.
The project is built with Python and Rust, combining the ease and flexibility of Python for high-level strategy logic and orchestration, with the speed and safety of Rust for low-level performance-critical components. Python powers the strategy engine, configuration handling, and overall control flow, while Rust is used for communicating with the Kraken exchange, ensuring fast and reliable data fetching for bid/ask prices and other market data.
Black Swan is designed to be lightweight and adaptable—ideal for developers, quant enthusiasts, and traders who want full control over how their strategies are designed, tested, and executed.
- Modular Strategy Engine – Plug-and-play support for custom trading strategies (e.g., RSI, SMA, custom ML).
- Kraken API Integration – Built specifically to interface with Kraken's REST and WebSocket APIs.
- Live & Paper Trading Modes – Choose between real execution or simulation.
- Backtesting Engine – Test strategies against historical Kraken market data.
- Logging & Performance Analytics – Track trades, performance, and KPIs over time.
- Secure Config Management – Store keys and strategy parameters safely via config files.
- Python 3.10+
- Rust (with
maturin
installed) pip
git clone https://github.com/GoneInactive/Black-Swan.git
cd black-swan
On Windows:
python -m venv venv
source venv/Scripts/activate
On Mac:
python -m venv venv
source venv/bin/activate
cd rust_client
maturin develop
cd .. # If not already in main directory
pip install -r requirements.txt
- Sign into your Kraken account using Kraken pro
- Click on your profile (top right corner)
- Select settings
- Select the
API
tab - Click
Create API key
- Select appropriate permissions
- Clcik
Generate key
at the bottom
Open up config/config.yaml
paste your keys and adjust settings as necessary.
In the config/config.yaml
directory, there are various tests to ensure the program is working properly.
python tests/(test).py
Example:
python tests/test_rust_client.py
Black-Swan/
├── README.md
├── LICENSE
├── .gitignore
├── requirements.txt / environment.yml
├── config/
│ └── config.yaml
├── rust_client/
│ ├── Cargo.toml
│ └── src/
│ ├── lib.rs
│ └── kraken_api.rs
├── data/
│ └── historical/ (or logs/, if storing logs here)
├── logs/
│ └── trade_log.txt
├── models/
│ └── strategy_model.py
├── src/
│ ├── __init__.py
│ ├── main.py
│ ├── trader.py
│ ├── kraken_api.py
│ ├── config_load.py
│ ├── strategy/
│ │ ├── __init__.py
│ │ ├── moving_average.py
│ │ └── rsi.py
│ ├── clients/
│ │ └── __init__.py
│ │ └── kraken_python_client.py
│ │ └── kraken_sync_client.py
│ ├── utils/
│ │ └── helpers.py
│ │ └── plotter.py
│ │ └── account_tools.py
├── tests/
│ ├── test_strategy.py
│ └── test_api.py
│ └── test_kraken_client.py
│ └── test_rust_client.py
└── docs/
└── architecture.md
Black Swan leverages the power of Rust for performance-critical operations, like interacting with the Kraken API, while Python is used for higher-level strategy development, backtesting, and other logic. This integration combines the best of both languages: Rust for speed and Python for flexibility.
Rust functions are exposed to Python via maturin
, which allows you to build and package Rust extensions into Python modules. For example, functions like get_bid()
and get_ask()
retrieve real-time market data from Kraken using Rust’s speed.
get_bid()
Fetches the current bid price for the selected trading pair.get_ask()
Fetches the current ask price for the selected trading pair.
To build the Rust extension and make it available for Python, use the following command:
maturin develop
from rust_kraken_client import get_bid, get_ask
def test_rust_integration():
print("Bid price:", get_bid()) # Call the Rust function to get the bid
print("Ask price:", get_ask()) # Call the Rust function to get the ask
if __name__ == "__main__":
test_rust_integration()
Rust handles the Kraken API requests efficiently. When you call functions like get_bid()
or get_ask()
, they internally handle API requests, error handling, and response parsing, ensuring high performance.
Follow https://opensource.guide/
Will update as common problems arise.