Actively developed

Barter guide

Barter brings a modular, strongly typed architecture to trading systems in Rust.

Last reviewed · Also known as barter-rs, barter-data

Quick answer

Barter is a family of open-source Rust crates for building trading systems: barter (an event-driven engine for live, paper and backtest), barter-data (normalized WebSocket market data from exchanges such as Binance, Bybit, OKX, Kraken and Coinbase), barter-execution and barter-integration. It suits developers who want Rust performance and type safety.

Barter at a glance

Category
HFT & market making
Language
Rust
License
MIT
Does
Backtesting, Live trading, Paper trading, Market data, Order execution
Markets
Crypto
Best for
Rust developers building low-latency crypto systems.
In AlgoGP
Use the exported strategy object from your own code

Pick it if

Rust developers building low-latency crypto systems.

Watch out for

Rust only.

Barter strengths and limitations

Strengths

  • Rust performance and safety.
  • Normalized multi-exchange streams.
  • Modular crates you can adopt piecemeal.

Limitations

  • Rust only.
  • Fewer batteries included than Python frameworks.

Barter example

cargo add barter barter-data barter-execution
Install
cargo add barter barter-data barter-execution tokio --features tokio/full
Add the crates.

Use Barter with AlgoGP

AlgoGP does not add Barter to projects automatically yet, but nothing stops you using them together. Every AlgoGP project exports plain Python with a framework-neutral strategy object, so you can call it from Barter yourself.

  1. 1

    Design and backtest in AlgoGP

    Describe the idea to the copilot and backtest it on AlgoGP’s normalized history.

  2. 2

    Add any bridge to get the adapter core

    Adding a bridged framework (for example Backtrader) writes frameworks/algogp_bridge.py, whose StrategyBridge.on_bar() returns the orders the strategy wants.

  3. 3

    Call it from Barter

    Feed Barter’s bars to StrategyBridge, place the returned orders with Barter, and report fills back with sync().

Barter connects to Binance, Bybit, OKX, Kraken, Coinbase Advanced Trade, Gate (Gate.io), Bitfinex, BitMEX. Each guide shows how to create the API key, which you can store in the project’s Keys & secrets.

Barter: frequently asked questions

Is there a Python framework like Barter?

NautilusTrader has a Rust core with a Python API.

Barter alternatives

Independent guide. AlgoGP is not affiliated with Barter. Features, licenses and maintenance change; check the official documentation. Nothing here is investment advice.

Build a strategy