Botvana is an open-source, event-driven, and distributed trading platform targeting crypto markets. It aims to be high-performance, low-latency, reliable, and fault-tolerant. Built in Rust, it allows you to develop and operate market-making and arbitrage strategies.
- High-performance: Designed and architected to be high-performance from the ground up. It utilizes staged event-driven architecture combined with thread-per-core architecture.
- Low-latency: Currently utilizing
io_uring
for network connectivity, with goals to useAF_XDP
or kernel by-pass in the future. - Reliable: Being built in Rust provides Botvana with memory safety guarantees compared to other systems programming languages.
- Fault-tolerant: Crypto exchanges are known for unreliability, so Botvana provides explicit fault-tolerant features.
Botvana is split into these components:
botnode
: high-performance trading botbotvana-server
: coordination serverbotvana
: shared platform definitionsstation-egui
: control application
Currently, in the early phase of the project, the supported exchanges are FTX and Binance.
Botnode uses thread-per-core architecture where each thread is pinned to exactly one logical CPU core. Each CPU core runs a different engine with a custom event loop. Data is sent between engines using SPSC channels, and no global state is shared between the threads.
Botnode has these engines:
- Control engine: Connects to
botvana-server
and spawns all other engines based on configuration. - Market data engine: Connects to the exchange and transforms market data to Botvana's internal types.
- Indicator engine: Provides indicators built from market data.
- Trading engine: Makes trading decisions.
- Exchange engine: Acts as order router and gateway to the exchange.
- Audit engine: Audits trading activity.
Each botnode
needs to connect to a central botvana-server
which provides
configuration and acts as the central coordinator.
Botvana server expects configuration in cfg/default.toml
.
Control station application written using egui framework.
In order to work with Botvana you need to have:
- Linux kernel version >5.13
- Rust 1.58 or higher
- Terraform
- Clone the repo
git clone https://github.com/featherenvy/botvana.git
- Install dependencies required to compile
egui
sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev
- Build all components
cargo build
- Run dependencies using
docker-compose
:docker-compose up -d
- Run
botvana-server
cargo r --bin botvana-server
- Run
botnode
SERVER_ADDR=127.0.0.1:7978 BOT_ID=0 cargo r --bin botnode
- Run
station-egui
cargo r --bin station-egui