Market data processing pipeline for stock market scanner
Project description
kuhl-haus-mdp
Market data processing pipeline for stock market scanner.
TL;DR
Non-business Massive (AKA Polygon.IO) accounts are limited to a single WebSocket connection per asset class and it has to be fast enough to handle messages in a non-blocking fashion or it'll get disconnected. The market data processing pipeline consists of loosely-coupled market data processing components so that a single WebSocket connection can handle messages fast enough to maintain a reliable connection with the market data provider.
Per, https://massive.com/docs/websocket/quickstart#connecting-to-the-websocket:
By default, one concurrent WebSocket connection per asset class is allowed. If you require multiple simultaneous connections for the same asset class, please contact support.
Components Summary
Non-business Massive (AKA Polygon.IO) accounts are limited to a single WebSocket connection per asset class and it has to be fast enough to handle messages in a non-blocking fashion or it'll get disconnected. The Market Data Listener (MDL) connects to the Market Data Source (Massive) and subscribes to unfiltered feeds. MDL inspects the message type for selecting the appropriate serialization method and destination Market Data Queue (MDQ). The Market Data Processors (MDP) subscribe to raw market data in the MDQ and perform the heavy lifting that would otherwise constrain the message handling speed of the MDL. This decoupling allows the MDP and MDL to scale independently. Post-processed market data is stored in the MDC for consumption by the Widget Data Service (WDS). Client-side widgets receive market data from the WDS, which provides a WebSocket interface to MDC pub/sub streams and cached data.
[]
Component Descriptions
Market Data Listener (MDL)
The MDL performs minimal processing on the messages. MDL inspects the message type for selecting the appropriate serialization method and destination queue. MDL implementations may vary as new MDS become available (for example, news).
MDL runs as a container and scales independently of other components. The MDL should not be accessible outside the data plane local network.
Market Data Queues (MDQ)
Purpose: Buffer high-velocity market data stream for server-side processing with aggressive freshness controls
- Queue Type: FIFO with TTL (5-second max message age)
- Cleanup Strategy: Discarded when TTL expires
- Message Format: Timestamped JSON preserving original Massive.com structure
- Durability: Non-persistent messages (speed over reliability for real-time data)
- Independence: Queues operate completely independently - one queue per subscription
- Technology: RabbitMQ
The MDQ should not be accessible outside the data plane local network.
Market Data Processors (MDP)
The purpose of the MDP is to process raw real-time market data and delegate processing to data-specific handlers. This separation of concerns allows MDPs to handle any type of data and simplifies horizontal scaling. The MDP stores its processed results in the Market Data Cache (MDC).
The MDP:
- Hydrates the in-memory cache on MDC
- Processes market data
- Publishes messages to pub/sub channels
- Maintains cache entries in MDC
MDPs runs as containers and scale independently of other components. The MDPs should not be accessible outside the data plane local network.
Market Data Cache (MDC)
Purpose: In-memory data store for serialized processed market data.
- Cache Type: In-memory persistent or with TTL
- Queue Type: pub/sub
- Technology: Redis
The MDC should not be accessible outside the data plane local network.
Widget Data Service (WDS)
Purpose:
- WebSocket interface provides access to processed market data for client-side code
- Is the network-layer boundary between clients and the data that is available on the data plane
WDS runs as a container and scales independently of other components. WDS is the only data plane component that should be exposed to client networks.
Service Control Plane (SCP)
Purpose:
- Authentication and authorization
- Serve static and dynamic content via py4web
- Serve SPA to authenticated clients
- Injects authentication token and WDS url into SPA environment for authenticated access to WDS
- Control plane for managing application components at runtime
- API for programmatic access to service controls and instrumentation.
The SCP requires access to the data plane network for API access to data plane components.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kuhl_haus_mdp-0.1.6.tar.gz.
File metadata
- Download URL: kuhl_haus_mdp-0.1.6.tar.gz
- Upload date:
- Size: 34.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d4771f8ebe81f6b7e0261a41c7608a1a8845645437eafdbde3f13f48032a717
|
|
| MD5 |
ce9309afa3341cafe9e15a23ddf74034
|
|
| BLAKE2b-256 |
b5dc3909572447207172a9da5002fc7e7bc0aa79eadb1e019afa89bcd5b85e82
|
Provenance
The following attestation bundles were made for kuhl_haus_mdp-0.1.6.tar.gz:
Publisher:
publish-to-pypi.yml on kuhl-haus/kuhl-haus-mdp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kuhl_haus_mdp-0.1.6.tar.gz -
Subject digest:
5d4771f8ebe81f6b7e0261a41c7608a1a8845645437eafdbde3f13f48032a717 - Sigstore transparency entry: 790918209
- Sigstore integration time:
-
Permalink:
kuhl-haus/kuhl-haus-mdp@e2a98b18e16b2898675cebbb8eeecd30f6a8a8a7 -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/kuhl-haus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@e2a98b18e16b2898675cebbb8eeecd30f6a8a8a7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file kuhl_haus_mdp-0.1.6-py3-none-any.whl.
File metadata
- Download URL: kuhl_haus_mdp-0.1.6-py3-none-any.whl
- Upload date:
- Size: 31.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5cf681d80c94be6172ff907f5165da184bae5fadbf78df45c972182dc1baed6
|
|
| MD5 |
fb64770b16dbc37845182dcd5c0cf9a0
|
|
| BLAKE2b-256 |
83e25e9c9d32e5bc9352b9c1d34c4639ab996a7b177e6c23ec3ba5611525313f
|
Provenance
The following attestation bundles were made for kuhl_haus_mdp-0.1.6-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on kuhl-haus/kuhl-haus-mdp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kuhl_haus_mdp-0.1.6-py3-none-any.whl -
Subject digest:
d5cf681d80c94be6172ff907f5165da184bae5fadbf78df45c972182dc1baed6 - Sigstore transparency entry: 790918213
- Sigstore integration time:
-
Permalink:
kuhl-haus/kuhl-haus-mdp@e2a98b18e16b2898675cebbb8eeecd30f6a8a8a7 -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/kuhl-haus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@e2a98b18e16b2898675cebbb8eeecd30f6a8a8a7 -
Trigger Event:
push
-
Statement type: