Skip to content

lorine93s/Hummingbot-gRPC-Microservice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hummingbot gRPC Microservice

Lightweight reference implementation that showcases how Hummingbot-style market data services can stream a real-time firehose through gRPC.

Why this Exists

Hummingbot popularized an open, high-frequency trading stack that separates the noisy market-data plane from latency-sensitive execution strategies. This repository recreates the critical pieces your client cares about:

  • gRPC-first transport – async streaming APIs for tickers and order books.
  • Connector layer – venues plug into a common interface (ExchangeConnector).
  • Router / fan-out core – multiplex snapshots to unlimited downstream consumers with backpressure handling.
  • Mock execution engineSubmitOrder RPC returns deterministic order IDs, so UI automation or strategy sandboxes can test end-to-end flows.

The goal is to provide production-ready scaffolding, clear documentation, and a place to extend real connectors or proprietary strategies.

Project Layout

hunmming-bot/
├─ proto/marketdata.proto         # gRPC definitions
├─ hummingbot/
│  ├─ config.py                   # Pydantic config models
│  ├─ logging_config.py           # Shared logging setup
│  ├─ connectors/                 # Exchange connectors (mock + base class)
│  ├─ core/                       # Market data router & execution engine
│  ├─ grpc/                       # Generated protobuf stubs + service impl
│  └─ scripts/                    # CLI entrypoints (server/client)
├─ config.example.yaml            # Sample deployment config
└─ README.md                      # You are here

Features

  • 🔌 Connector abstraction – add CEX/DEX adapters by subclassing ExchangeConnector.
  • Market data firehose – multiplex millions of updates/min via MarketDataRouter queues and gRPC streaming RPCs.
  • 📊 Ticker + order book streaming – both aggregated top-of-book and level-2 depth snapshots.
  • 🪪 Order submission mockSubmitOrder RPC acknowledges requests and logs execution for strategy prototyping.
  • 🧪 Deterministic mock venue – configure symbols, depth, and cadence via YAML to simulate venues in CI or demos.
  • 🛠️ CLI toolinghb-server launches the service, hb-client inspects streams with Rich-powered output.

Architecture (Hummingbot-style)

Layer Responsibility
Connector WebSocket/REST ingestion, snapshot normalization
Router Core Subscription registry, fan-out queues, backpressure + filtering
Strategy Plug your MM/arbitrage logic here, subscribe via gRPC or direct python imports
Execution ExecutionEngine placeholder for DMA/OMS integrations
Transport gRPC service exposes StreamTickers, StreamOrderBook, and SubmitOrder APIs

This mirrors production Hummingbot deployments where the data plane is decoupled from the strategy plane. You can split components into separate containers or processes as throughput requirements grow.

Extending

  • Implement a real connector by subclassing ExchangeConnector and registering it in CONNECTOR_FACTORIES.
  • Replace ExecutionEngine with a real OMS or smart-order-router.
  • Add auth/TLS by customizing run_server.py (mutual TLS, JWT, API keys, etc.).
  • Emit metrics by tapping into the router broadcast loop.
  • Scale horizontally by running multiple connectors and using a message bus (NATS, Kafka) instead of the in-process queue.

About

High-frequency crypto market-making stack powered by a gRPC market-data firehose, modular exchange connectors, and mock execution engine—ready to extend into production-grade Hummingbot deployments.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages