Spire Services
Spire is a distributed trading platform composed of multiple specialized servers that work together to provide a complete trading infrastructure. Each server is independently deployable, communicates through well-defined service interfaces, and authenticates through a central Service Locator.
Contents
Architecture Principles
- Service-Oriented Design - Each server provides a focused set of functionality
- Distributed Deployment - Services can be deployed across multiple machines for scalability
- Centralized Authentication - All services authenticate through the Service Locator
- Persistent Storage - Critical data persisted to MySQL for durability
- Real-time Updates - Services publish updates to subscribed clients
Servers
- Service Locator - Centralized authentication, account management, and service discovery
- Uid Server - Generates unique identifiers for orders and other entities
- Administration Server - Manages account roles, entitlements, risk parameters, and trading permissions
- Web Portal - Web-based interface for account management and administrative tasks
- Definitions Server - Provides reference data (countries, currencies, venues, trading schedules)
- Market Data Server - Receives, sequences, and persists market data from feed clients
- Market Data Relay Server - Load-balanced distribution of market data to end users
- Charting Server - Processes time series queries for candlestick and technical analysis data
- Compliance Server - Manages compliance rules and monitors violations
- Risk Server - Monitors profit/loss, enforces risk limits, manages account state transitions
- Order Execution Server - Routes orders to venues, tracks execution, enforces controls
Operations
All servers follow consistent operational patterns. In addition to individual server management scripts, the platform provides aggregate scripts for managing all servers collectively.
Installation
The install.sh script is designed for the latest Ubuntu Server LTS and performs a complete system installation including:
- Installing system dependencies (build tools, MySQL, Node.js, Python packages)
- Configuring MySQL database and creating the spire schema
- Creating service accounts in the Service Locator
- Setting up initial permissions and directory structure
- Configuring all servers with appropriate network settings
The installation script automatically creates service accounts for all servers and assigns them to the appropriate permission groups.
Configuration
The setup.py script configures all servers by propagating common settings across individual server configurations. This script calls each server's individual setup script with appropriate parameters, ensuring consistent configuration across the platform.
Starting and Stopping
The start.sh script starts all servers in dependency order. After starting all servers, the script automatically runs reset_risk_states.py to initialize risk state for the trading session.
The stop.sh script gracefully stops all servers in reverse dependency order, ensuring that dependent services shut down before the services they depend on.
The check.sh script verifies that all servers are running and reports the status of each service. It exits with a non-zero status if any server is not running, making it suitable for monitoring and health check automation.
