Overview
BlackOrigin is a scalable marketplace trading bot platform built for an Australian fintech client. Traders browse a catalogue of automated trading bots, subscribe to strategies they want to run, and monitor live execution — all from a single dashboard. Behind the UI sits a high-throughput bot execution engine that manages order placement, position tracking, and real-time signal delivery across thousands of concurrent sessions.
The Marketplace Model
The product is structured as a two-sided marketplace: bot developers publish trading strategies; retail traders subscribe and activate them against their own brokerage credentials. This required a multi-tenant execution layer where each active bot subscription runs in isolation — one subscriber's poor execution timing cannot affect another's fills.
Each bot subscription is represented as an independent queue consumer. When a signal fires, only the consumers bound to that strategy receive the execution message — fan-out is scoped, not broadcast.
RabbitMQ Dual-Queue Execution Engine
The core architectural decision was separating bot executionfrom live update streaming using a dual-queue design in RabbitMQ. Execution messages flow through a high-priority queue with strict ordering guarantees and no backpressure from read traffic. Market data, PNL ticks, and position changes fan out through a separate exchange.
This isolation ensures that a sudden spike in update traffic — e.g. a macro event moving multiple markets simultaneously — cannot starve the execution queue. Trade fills land with consistent, predictable latency regardless of dashboard activity.
Real-Time WebSocket Feeds
Live PNL, open positions, trade history, and bot status updates are pushed to connected traders over WebSocket using Laravel Reverb backed by Redis pub-sub. Calculations run server-side on each price tick and broadcast to the trader's private channel — clients never poll.
Sub-second latency is maintained from price feed ingestion through to the trader's browser. The WebSocket layer handles thousands of concurrent connections across multiple application instances without degradation.
Redis Caching & Pub-Sub
Active bot state, open order lookups, and current position snapshots are served from Redis to avoid hot-path database reads during peak execution windows. Price feed distribution uses Redis pub-sub to fan out across multiple application instances simultaneously, enabling horizontal scaling without a single distribution bottleneck.
Scalable Deployment
The bot execution engine is isolated as a self-contained module with its own queue consumers and event handlers, independently deployable and scalable from the user-facing application. The full stack runs on VPS with an automated CI/CD pipeline — deploys are zero-downtime with no interruption to live bot sessions.
Tech Stack
- Backend: Laravel, PHP 8.2, MySQL
- Messaging: RabbitMQ (dual-queue), Laravel Reverb
- Cache / Pub-Sub: Redis
- Frontend: Next.js
- Infra: VPS, Nginx, CI/CD pipeline