Exchange Toolkit

Overview

Reference implementations for exchange operators, providing production-grade examples in Python and Java covering data gateways, caching services, orderbook aggregation, and data warehousing.

Item
Details

Python

3.10+

Java

17+

Installation

git clone https://github.com/infoway-api/infoway-exchange-toolkit.git
cd infoway-exchange-toolkit
pip install -r requirements.txt  # Python examples

Python Examples

Multi-Market WebSocket Gateway

python examples/market_data_gateway/gateway.py

Unified multi-market real-time data gateway:

  • Simultaneous connections to stock, crypto, and common market WebSockets

  • Unified trade data aggregation

  • Runtime statistics (trades/sec, uptime, per-market counts)

  • Signal handling with graceful shutdown

Plate Data Service

Cached sector data query service:

  • In-memory cache with automatic background refresh

  • Thread-safe (RLock)

  • Configurable TTL

  • Supports industry, concept, and constituent queries

Orderbook Aggregator

Multi-symbol orderbook aggregation and analysis:

  • Aggregates bid/ask data across multiple symbols

  • Calculates spread, mid-price, book imbalance, total volume

  • Cross-symbol analysis (widest/tightest spread, most liquid, highest imbalance)

  • Supports stock, crypto, and common market types

K-line Data Warehouse

SQLite-based local K-line data warehouse:

  • SQLite storage with (symbol, timestamp) primary key

  • Incremental sync (only fetches newer data)

  • Batch sync with rate-limit protection

  • Date-range queries

Java Examples

WebSocket Gateway

Java multi-market WebSocket gateway for stock and crypto real-time data.

Market Data Service

REST market data query service built on the Infoway Java SDK.

Last updated