apostleoffinance
prediction-market-maker-bot
Rust

Market-making execution bot for binary prediction markets with adaptive pricing, inventory management, and risk controls. Rust implementations.

Last updated Jun 11, 2026
14
Stars
3
Forks
0
Issues
0
Stars/day
Attention Score
41
Language breakdown
Rust 100.0%
โ–ธ Files click to expand
README

Quant Execution Bot - Rust Implementation

A high-performance market-making execution bot for binary event contracts (prediction markets) implemented in Rust.

๐Ÿš€ Features

  • Adaptive Spread Management: Dynamically adjusts spreads based on order flow imbalance and inventory
  • Inventory Skew: Shades mid prices to manage accumulated positions
  • Risk Controls: Inventory limits, exposure limits, and drawdown tracking
  • Mean Reversion: Mid prices slowly revert toward fair value (0.5)
  • Deterministic Simulation: Reproducible results with seeded RNG

๐Ÿ“ Project Structure

quantbotrust/
โ”œโ”€โ”€ Cargo.toml                 # Project dependencies
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ main.rs                # Entry point and simulation orchestrator
โ”‚   โ”œโ”€โ”€ market_state.rs        # Market state container and trade recording
โ”‚   โ”œโ”€โ”€ market_maker.rs        # Core quoting logic and adaptation algorithms
โ”‚   โ”œโ”€โ”€ execution_engine.rs    # Simulation driver and order flow generator
โ”‚   โ””โ”€โ”€ logger.rs              # CSV report writer
โ”œโ”€โ”€ simulation_report.csv      # Final metrics (generated)
โ””โ”€โ”€ trace.json                 # Time-series data (generated)

๐Ÿ› ๏ธ Build & Run

Prerequisites

  • Rust 1.70+ (install via rustup)

Build

cargo build --release

Run

cargo run --release

Expected Output

๐Ÿš€ Quant Execution Bot - Rust Implementation
============================================

๐Ÿ“Š Running simulation with 200 steps...

โœ… Simulation complete. Report written to: simulation_report.csv โœ… Trace data written to: trace.json

๐Ÿ“ˆ Final Market States:


๐Ÿช inflationgt20 { ... } ๐Ÿช teamxwins { ... } ๐Ÿช electioncandidatea { ... }

๐Ÿ“Š Summary Statistics:


Total PnL: 565.4478 Total Fills: 1189 ...

๐Ÿ“Š Output Files

| File | Description | |------|-------------| | simulation_report.csv | Final metrics for all markets (PnL, fills, drawdown, etc.) | | trace.json | Step-by-step time-series data for analysis |

๐Ÿช Simulated Markets

| Market | Initial Mid | Description | |--------|-------------|-------------| | inflationgt20 | 0.30 | "Will inflation exceed 20%?" | | electioncandidatea | 0.55 | "Will Candidate A win?" | | teamxwins | 0.50 | "Will Team X win?" |

๐Ÿ”ง Configuration

Modify market parameters in main.rs:

let mut market = MarketState::new("my_market", 0.50);
market.inventory_limit = 200.0;   // Max inventory
market.exposure_limit = 10000.0;  // Max exposure
market.spread = 0.05;             // Initial spread

๐Ÿ“ˆ Performance

  • Zero-copy operations where possible
  • Efficient HashMap-based market lookups
  • Deterministic PRNG (ChaCha8) for reproducibility
  • Release mode optimizations
  • Memory-safe with no garbage collection overhead

๐Ÿ“„ License

MIT

๐Ÿ”— More in this category

ยฉ 2026 GitRepoTrend ยท apostleoffinance/prediction-market-maker-bot ยท Updated daily from GitHub