Skip to content

wlvchandler/atra

Repository files navigation

Atra

forthebadge CI/CD

Components

Component Description Language Role
atra-ob Core matching engine Rust High-performance order matching and book management
atra-cli Command-line interface Python User interaction and order entry
atra-proto Protocol definitions Protobuf Shared data contracts and API specifications
atra_gateway Real-time gateway Elixir Connection management and real-time engine access

Quick Start

# Build all containers
docker compose build
docker build -t atra-cli -f atra-cli/Dockerfile .

# Start the matching engine
docker compose up -d orderbook

# Place orders using the CLI wrapper
./invm buy 50@15 25@14 sell 19@11.20

CLI Usage

The invm script provides a user-friendly interface to the trading system:

./invm COMMAND [OPTIONS]

Commands:
    book DEPTH              # View order book to specified depth
    (buy|sell) ORDERS...    # Place one or more orders

Order Format:
    AMOUNT[@PRICE]         # Market order if price omitted

Examples:
    ./invm book 10         # Show top 10 levels
    ./invm sell 100@10     # Limit sell 100 @ 10
    ./invm buy 300         # Market buy 300

Development Setup

Matching Engine (Rust)

cd atra-ob
cargo build

# Run tests
cargo nextest run

# Start engine
cargo run --bin server

Deterministic sequencing flags:

# number of stable processing lanes (parallel across lanes, serial in-lane)
export ATRA_LANE_COUNT=4

# strict sequence gate: reject stale/gap/out-of-order sequence numbers
export ATRA_STRICT_SEQUENCE_VALIDATION=true

CLI (Python)

cd atra-cli
./scripts/setup_dev
source venv/bin/activate

Gateway (Elixir)

cd atra_gateway
mix deps.get
mix compile
iex -S mix

Gateway deterministic ingress flags:

export ATRA_GATEWAY_LANE_COUNT=4
export ATRA_GATEWAY_STRICT_SEQUENCE_VALIDATION=true

Project Structure

├── atra-ob/        # Rust matching engine
├── atra-cli/       # Python CLI
├── atra-proto/     # Shared protocol definitions
└── atra_gateway/   # Elixir gateway service

Documentation

Detailed documentation available in the doc/ directory:

  • Architecture diagrams
  • Component specifications
  • Data flow descriptions
  • Performance analysis

About

high performance generic trading platform framework (wip)

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors