Skip to main content

Rithmic R|API+ MBO & Trade Data Bridge - ZeroMQ PUB/SUB bridge system

Project description

Rithmic MBO & Trade Data Bridge

PyPI version License: MIT

A high-performance market data bridge that connects to Rithmic via R|API+ (.NET) and publishes MBO (Market-by-Order) and Trade data over ZeroMQ. Designed for low-latency algorithmic trading and RL (Reinforcement Learning) environments.

日本語版はこちら (Japanese version)

Architecture

sequenceDiagram
    participant Client as Client Application (WSL2/Linux/Python)
    participant Publisher as Rithmic Bridge Publisher (Windows)
    participant Rithmic as Rithmic Infrastructure (R|API+)

    Note over Publisher, Rithmic: Connects via Plugin Mode (Port 56000)
    Publisher->>Rithmic: Subscribe(Symbol, Exchange)
    Rithmic-->>Publisher: Market Data (MBO/Trade)
    Publisher-->>Client: ZeroMQ PUB (Stream Data)
    Client->>Publisher: ZeroMQ REQ (Dynamic Subscription)

Features

  • Dynamic Subscription: Subscribe to symbols on-the-fly without restarting the server.
  • MBO Support: Real-time Order Book reconstruction (Level 3 data).
  • ZeroMQ Distribution: Publish data to multiple clients over the network (e.g., from Windows to WSL2).
  • Python Library: Ready-to-use RithmicClient class for easy integration.
  • Low Latency: Optimized queue management and data serialization.

Prerequisites

  • Windows 10/11 (for the Publisher)
  • R | API+ (.NET) from Rithmic
  • R | Trader Pro (for Plugin Mode connection)
  • Python 3.10+

Installation

1. R | API+ (.NET) Setup

This project requires the Rithmic API library rapiplus.dll. Redistribution of this DLL is prohibited.

  1. Request the API: Visit https://www.rithmic.com/api-request and request the R | API (.NET).
  2. Installation: Place the rapiplus.dll from the downloaded package into the standard Rithmic path: C:\Program Files (x86)\Rithmic\Rithmic Trader Pro\rapiplus.dll

2. Install the Bridge

pip install rithmic-bridge

Quick Start

1. Launch the Publisher (Windows)

Launch the publisher in R|API mode. You can provide credentials via command-line arguments:

rithmic-bridge-publisher --mode rapi --user YOUR_USER --password YOUR_PASS --symbol GCJ6 --exchange COMEX

Note: Use --mode dummy for testing without a Rithmic account.

2. Use the Client Library (Client/WSL2)

from rithmic_bridge.client.library import RithmicClient

# Connect to the publisher on Windows
client = RithmicClient(host="192.168.x.x")

# Define callbacks
def on_mbo(event):
    print(f"MBO: {event.price} x {event.size}")

def on_trade(event):
    print(f"TRADE: {event.price} @ {event.size}")

client.on_mbo(on_mbo)
client.on_trade(on_trade)

client.connect()
client.subscribe("GCJ6", "COMEX")

# Keep the script running
import time
while True:
    time.sleep(1)

3. CLI Client

You can also use the built-in CLI client for quick monitoring:

rithmic-bridge-client --host 192.168.x.x --symbol GCJ6 --exchange COMEX

Configuration

The system can be configured via command-line arguments (recommended) or a .env file.

Argument Description Default
--mode rapi or dummy dummy
--user Rithmic username -
--password Rithmic password -
--symbol Default symbol GCJ6
--exchange Exchange COMEX
--bind ZMQ bind address tcp://*:5555
--dll-dir Path to rapiplus.dll (Standard paths)

Development

We use uv for dependency management.

git clone https://github.com/akivajp/rithmic-bridge
cd rithmic-bridge
uv sync

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rithmic_bridge-1.0.0.tar.gz (122.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rithmic_bridge-1.0.0-py3-none-any.whl (44.3 kB view details)

Uploaded Python 3

File details

Details for the file rithmic_bridge-1.0.0.tar.gz.

File metadata

  • Download URL: rithmic_bridge-1.0.0.tar.gz
  • Upload date:
  • Size: 122.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for rithmic_bridge-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e67bec0264b54ae21acbf6100363278b46bac11f0e173b4ea33eb202f27fbdff
MD5 6044203065bf182b16788635f37a0c52
BLAKE2b-256 67ffab27c3ad4d5e64cfd9098ea11047bcc9f7b9fed0f2e16779426faf2c2e68

See more details on using hashes here.

File details

Details for the file rithmic_bridge-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: rithmic_bridge-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 44.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for rithmic_bridge-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2dec3b8b4323f97fa3d31d516dcd413a62e3a1115209f0a6489333397021bd28
MD5 09b1a4d265283e4358dd6f82481acbd6
BLAKE2b-256 07d00bf269e9703a3fd8e5291fe8c4353826cf6b26983f4d473e9a8ef7da4939

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page