https://github.com/thomvanoorschot/zigma
Zigma is an algorithmic trading framework built with the Zig programming language, leveraging an actor-based concurrency model. It aims to provide an efficient, low-latency system for algorithmic trading through components handling market data, strategy execution, order management, risk, and data persistence.
https://github.com/thomvanoorschot/zigma
actor actor-framework concurrency quantitative-finance trading wasm zig ziglang
Last synced: 3 months ago
JSON representation
Zigma is an algorithmic trading framework built with the Zig programming language, leveraging an actor-based concurrency model. It aims to provide an efficient, low-latency system for algorithmic trading through components handling market data, strategy execution, order management, risk, and data persistence.
- Host: GitHub
- URL: https://github.com/thomvanoorschot/zigma
- Owner: Thomvanoorschot
- Created: 2025-03-15T15:53:46.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-03-30T15:14:09.000Z (9 months ago)
- Last Synced: 2025-03-30T15:30:35.531Z (9 months ago)
- Topics: actor, actor-framework, concurrency, quantitative-finance, trading, wasm, zig, ziglang
- Language: Zig
- Homepage:
- Size: 10.3 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Zigma: Actor-Based Algorithmic Trading Framework
## Overview
Zigma is an algorithmic trading framework built with the Zig programming language, leveraging an actor-based concurrency model. This project serves as both a practical trading system and an educational exploration of Zig's memory management capabilities and concurrency patterns.
## Goals
• Implement a robust actor framework for handling concurrent trading operations \
• Explore Zig's memory management features in depth \
• Develop efficient, low-latency trading algorithms \
• Create a modular system that can be extended with new strategies and market connectors \
• Serve as a learning resource for Zig programming best practices
## Architecture
Zigma is built around an actor model, where independent components communicate through message passing:
### Server (Zig)
• Market Data Actors – Connect to exchanges and process incoming market data \
• Strategy Actors – Implement trading algorithms and generate signals \
• Order Management Actors – Handle order creation, modification, and cancellation \
• Risk Management Actors – Monitor positions and enforce trading limits \
• Persistence Actors – Handle data storage and retrieval \
• WebSocket Server – Provides real-time data streaming to clients via non-blocking WebSocket connections
### Client (WASM)
• WASM Application – Runs entirely in the browser for real-time market data visualization \
• Web Workers – Handle WebSocket connections in separate threads for non-blocking data fetching \
• Real-time UI – Interactive orderbook visualization with ImGui-based interface
## Features
### Server
• Non-blocking, concurrent processing of market data \
• Memory-efficient implementation with minimal allocations \
• Type-safe message passing between actors \
• WebSocket-based client communication \
• Pluggable strategy system for implementing various trading algorithms \
• Comprehensive logging and monitoring \
• Provides real-time visibility into the actor system through an "Inspector" graphical interface
### Client
• WASM-based client application for cross-platform compatibility \
• Non-blocking data fetching using WASM Web Workers \
• Real-time WebSocket communication with the server \
• Interactive orderbook windows with live market data \
• Responsive UI that doesn't block on network operations
## Learning Outcomes
This project provides hands-on experience with: \
• Zig's comptime features and metaprogramming \
• Manual memory management with allocators \
• Error handling patterns in Zig \
• Concurrency without shared state \
• Performance optimization techniques \
• Safe interoperability with C libraries \
• WebAssembly compilation and deployment \
• Web Workers for non-blocking browser applications \
• WebSocket protocol implementation and optimization
## Getting Started
(Instructions for building and running the project will be added as development progresses.)
## Project Status



🚧 Early Development – The actor framework and core components are currently being designed and implemented.