Skip to main content

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

# Recommended for local editable CLI usage
uv tool install --editable .

Quick Start

1. Launch the Publisher (Windows)

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

uvx rithmic-bridge publish --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:

uvx 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

Metadata

Release files for rithmic-bridge 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rithmic-bridge 1.0.1
File Size Uploaded Provenance
rithmic_bridge-1.0.1.tar.gz 128.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for rithmic-bridge 1.0.1
File Interpreter ABI Platform
rithmic_bridge-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 182.4 kB

Release files / rithmic_bridge-1.0.1.tar.gz

Download URL rithmic_bridge-1.0.1.tar.gz
Size 128.6 kB
Tags Source
SHA-256 checksum
How to use checksums
60076d7e3a365cec5636fab614ac31c47823277189859590d4043a8f175d397c
BLAKE2b-256 checksum
How to use checksums
b7af4c2277806f5cecca3eb35ffb9ef1b313d4253a1870b308f6059abce6a8e2
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / rithmic_bridge-1.0.1-py3-none-any.whl

Download URL rithmic_bridge-1.0.1-py3-none-any.whl
Size 53.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
359bc96dbc018565183e2d6473f6225c4b72cb208772c4990ece595adf6f7520
BLAKE2b-256 checksum
How to use checksums
0914f33178a2eac63c6a5ac08417eab0e464692a8dd51354189769c50971da75
Upload date
Uploaded using Trusted Publishing?
What is 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}

Security for rithmic-bridge 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page