Public multi-exchange crypto market-data composite toolkit.
Project description
crypto-composite-market-data
Public multi-exchange crypto market-data composite toolkit.
crypto-composite-market-data builds reproducible JSON artifacts from public Binance, OKX and Bybit endpoints. It focuses on market-data normalization, timestamp-aligned OHLCV composition, composite orderbook ladder buckets, multi-symbol universe runs, local artifact inspection, and data-quality reporting.
Note: PyPI/Shields badges can take a few minutes to refresh after a new release.
Why this exists
Public crypto market data is fragmented. A single exchange can be stale, unavailable, noisy, rate-limited, or structurally different from the broader venue set.
This project helps developers and researchers answer practical data-quality questions before using market data downstream:
- Which venues returned usable data?
- Is composite OHLCV coverage complete or partial?
- Are prices dispersed across venues?
- Is orderbook depth concentrated in one venue?
- Which assets in a universe have enough public data to inspect?
- Which JSON artifacts were generated and where are they?
Who it is for
- Data engineers building repeatable public crypto data pipelines.
- Quant researchers who need auditable input artifacts before analysis.
- Dashboard builders who want stable JSON files instead of exchange-specific payloads.
- Open-source contributors who want a small, testable market-data infrastructure project.
What it does
- Fetches public OHLCV, recent trades, orderbook snapshots, funding and open-interest data.
- Normalizes records into stable Python dataclasses.
- Builds timestamp-aligned composite OHLCV by market type.
- Builds public composite orderbook ladder buckets near a reference price.
- Reports venue coverage, price dispersion and composite status.
- Runs explicit multi-symbol universes and writes per-asset artifact folders.
- Serves a read-only local artifact dashboard API.
- Writes reproducible JSON artifacts for research, dashboards and downstream analytics.
What it does not do
- No trading signals.
- No order execution.
- No private exchange account APIs.
- No position sizing.
- No financial advice.
- No private orderflow or market-maker intent claim.
- No profitability or statistical-edge claim.
Install
From PyPI:
pip install crypto-composite-market-data
From TestPyPI for release candidates:
python -m pip install \
--index-url https://test.pypi.org/simple/ \
--extra-index-url https://pypi.org/simple/ \
crypto-composite-market-data
For local development:
git clone https://github.com/thanhlq8-max/crypto-composite-market-data.git
cd crypto-composite-market-data
python -m pip install -r requirements-dev.txt
python -m pip install -e .
python -m pytest -q
5-minute quickstart
Create a small multi-asset universe:
crypto-composite universe \
--assets BTC-USDT,ETH-USDT,SOL-USDT \
--venues binance,okx,bybit \
--market-types spot_usdt,perp_usdt \
--timeframes 15m \
--limit 100 \
--out-dir artifacts-universe
Inspect the generated files:
artifacts-universe/
|-- BTC-USDT/
| |-- composite_ohlcv_15m.json
| |-- composite_orderbook_ladder_15m.json
| |-- data_quality.json
| `-- run_summary.json
|-- ETH-USDT/
|-- SOL-USDT/
`-- universe_summary.json
Serve the read-only local artifact API:
```bash
crypto-composite dashboard \
--artifact-root artifacts-universe \
--host 127.0.0.1
Open:
http://127.0.0.1:18080/api/health
http://127.0.0.1:18080/api/artifacts
See docs/QUICKSTART_5_MIN.md for Windows and venv-safe commands.
Single-asset run
crypto-composite run \
--asset BTC-USDT \
--venues binance,okx,bybit \
--market-types spot_usdt,perp_usdt \
--timeframes 15m \
--limit 300 \
--depth 100 \
--out-dir artifacts
Equivalent module form:
python -m crypto_composite.cli run \
--asset BTC-USDT \
--venues binance,okx,bybit \
--market-types spot_usdt,perp_usdt \
--timeframes 15m \
--out-dir artifacts
Useful output preview
A data_quality.json artifact summarizes whether downstream consumers should trust the generated composite data:
{
"timeframes": {
"15m": {
"ohlcv_status": "COMPOSITE_DATA_OK",
"book_status": "COMPOSITE_BOOK_OK",
"ohlcv_coverage": 1.0,
"book_coverage": 1.0
}
}
}
A universe_summary.json artifact summarizes multi-symbol runs without producing rankings or trading signals:
{
"asset_count": 3,
"assets": ["BTC-USDT", "ETH-USDT", "SOL-USDT"],
"boundaries": [
"No trading signals, order execution, position sizing, or financial advice."
]
}
Sample illustrative artifacts are available under examples/sample_artifacts.
Output artifacts
For each timeframe:
artifacts/raw_scan_15m.json
artifacts/composite_ohlcv_15m.json
artifacts/composite_orderbook_ladder_15m.json
Combined outputs:
artifacts/composite_ohlcv.json
artifacts/composite_orderbook_ladder.json
artifacts/data_quality.json
artifacts/run_summary.json
Multi-symbol output:
artifacts-universe/<ASSET>/...
artifacts-universe/universe_summary.json
Supported scope
| Area | Supported |
|---|---|
| Venues | Binance, OKX, Bybit |
| Asset format | BASE-USDT, for example BTC-USDT |
| Market types | spot_usdt, perp_usdt |
| Timeframes | 1m, 5m, 15m, 1h |
| Data access | Public REST endpoints only |
| Python | 3.11, 3.12, 3.13 |
Composite OHLCV model
For each timestamp and market type, the engine computes:
- weighted open;
- high / low envelope;
- median close;
- quote-volume-weighted close;
- total base and quote volume;
- venue weights;
- venue coverage;
- price dispersion percentage;
- data-quality score.
Status labels:
COMPOSITE_DATA_OK
COMPOSITE_DATA_PARTIAL
COMPOSITE_DATA_WEAK
Composite orderbook ladder model
The ladder engine merges public orderbook snapshots into near-book price buckets. For each bucket, it computes:
- quote depth;
- contributing venue count;
- venue depth map;
- HHI concentration;
- persistence proxy;
- spoof-risk proxy;
- vacuum score.
Status labels:
COMPOSITE_BOOK_OK
COMPOSITE_BOOK_PARTIAL
COMPOSITE_BOOK_WEAK
Local dashboard API
Serve a read-only local artifact API:
crypto-composite dashboard --artifact-root artifacts-universe --host 127.0.0.1 --port 18080
Endpoints:
/api/health
/api/artifacts
/api/artifact?path=<relative-json-path>
Community and contribution
Useful first contributions:
- Add a new public exchange connector.
- Improve mocked connector parser coverage.
- Add CSV or DuckDB artifact export.
- Improve Windows setup documentation.
- Build a small static frontend on top of the read-only dashboard API.
- Add schema validation for output artifacts.
See CONTRIBUTING.md, CODE_OF_CONDUCT.md, the GitHub issue templates, and docs/GOOD_FIRST_ISSUES.md.
Limitations
Public exchange APIs can rate-limit, return incomplete data, or temporarily fail.
The orderbook ladder is a public snapshot bucket proxy; it is not a private, full-depth, consolidated matching-engine book.
This project is data infrastructure. Any downstream research or visualization must preserve the no-signal, no-execution, no-financial-advice boundary unless explicitly implemented in a separate project with its own validation and legal review.
Packaging
See docs/PACKAGING.md for TestPyPI/PyPI release preparation.
Development roadmap
See:
- docs/ROADMAP.md
- docs/USEFUL_OUTPUTS.md
- docs/DASHBOARD_PLAN.md
- docs/DASHBOARD_API.md
- docs/PACKAGING.md
- docs/COMMUNITY_GROWTH.md
- docs/ADOPTION_PLAYBOOK.md
- docs/CLAUDE_FOR_OSS_READINESS.md
- docs/RELEASE_CHECKLIST.md
License
Apache License 2.0. See LICENSE.
Artifact quality scoring
After generating artifacts, compute a compact quality score:
crypto-composite score-artifacts --artifact-root artifacts-universe --write
This writes quality_score.json with a reproducible A-F grade based on venue coverage, composite OHLCV coverage, price dispersion, orderbook coverage and existing data-quality status. The score is for artifact inspection only; it is not a trading signal or prediction score.
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 crypto_composite_market_data-0.5.1.tar.gz.
File metadata
- Download URL: crypto_composite_market_data-0.5.1.tar.gz
- Upload date:
- Size: 36.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06a66ced348e2af49ef1704b3de37f7fa8c9ff77828c4e6093ba3b5449e140f6
|
|
| MD5 |
4f01eef5318bb8b0d6b47f1a24908dc0
|
|
| BLAKE2b-256 |
833ff45e4c4d1eec91b4105fde28a9ed15d4c1673ed1bda7aa277b43cf082deb
|
Provenance
The following attestation bundles were made for crypto_composite_market_data-0.5.1.tar.gz:
Publisher:
publish-pypi.yml on thanhlq8-max/crypto-composite-market-data
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
crypto_composite_market_data-0.5.1.tar.gz -
Subject digest:
06a66ced348e2af49ef1704b3de37f7fa8c9ff77828c4e6093ba3b5449e140f6 - Sigstore transparency entry: 1868669333
- Sigstore integration time:
-
Permalink:
thanhlq8-max/crypto-composite-market-data@da5cba024288ac3dd2e74233bd5b716c21038f53 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/thanhlq8-max
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@da5cba024288ac3dd2e74233bd5b716c21038f53 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file crypto_composite_market_data-0.5.1-py3-none-any.whl.
File metadata
- Download URL: crypto_composite_market_data-0.5.1-py3-none-any.whl
- Upload date:
- Size: 34.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15783c4dc541ba3947e051f07097d6f9a6589a29428b73a08b2f25e56d86f984
|
|
| MD5 |
d889264a3dd29b6dff5e68f32803069f
|
|
| BLAKE2b-256 |
87b22140bcb15fc0ab6dd80bbfd021ecd8ddc548c54f8361db3c0a0ce5ca876f
|
Provenance
The following attestation bundles were made for crypto_composite_market_data-0.5.1-py3-none-any.whl:
Publisher:
publish-pypi.yml on thanhlq8-max/crypto-composite-market-data
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
crypto_composite_market_data-0.5.1-py3-none-any.whl -
Subject digest:
15783c4dc541ba3947e051f07097d6f9a6589a29428b73a08b2f25e56d86f984 - Sigstore transparency entry: 1868669456
- Sigstore integration time:
-
Permalink:
thanhlq8-max/crypto-composite-market-data@da5cba024288ac3dd2e74233bd5b716c21038f53 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/thanhlq8-max
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@da5cba024288ac3dd2e74233bd5b716c21038f53 -
Trigger Event:
workflow_dispatch
-
Statement type: