A compact aggregate order-book market simulator.
Project description
orderwave
Compact aggregate order-book simulation for Python.
orderwave generates a sparse bid/ask book, samples limit/market/cancel flow from explicit distributions, and records a small summary history. The public API is intentionally narrow: build a Market, step or run it, inspect the latest snapshot, and read the summary frame.
Install
pip install orderwave
Quick Start
from orderwave import Market
market = Market(seed=42)
result = market.run(steps=1_000)
snapshot = result.snapshot
history = result.history
Common overrides stay in config:
from orderwave import Market, MarketConfig
config = MarketConfig(
market_rate=3.0,
fair_price_vol=0.45,
max_spread_ticks=4,
)
market = Market(seed=7, config=config)
market.gen(steps=500)
snapshot = market.get()
Public API
Market(...): create a simulator with an initial price, tick size, visible depth, seed, and optionalMarketConfig.step(): advance one step and return the latest snapshot.gen(steps): run multiple steps and return the latest snapshot.run(steps): returnSimulationResult(snapshot=..., history=...).get(): return the current snapshot as adict.get_history(): return the summary history as apandas.DataFrame.
Snapshot fields:
steplast_pricemid_pricebest_bidbest_askspreadbidsasksbid_depthask_depthdepth_imbalancebuy_aggr_volumesell_aggr_volumefair_price
History columns:
steplast_pricemid_pricebest_bidbest_askspreadbid_depthask_depthdepth_imbalancebuy_aggr_volumesell_aggr_volumefair_price
Model
The simulator keeps only one internal model family:
- Fair price follows a bounded mean-reverting Gaussian process.
- Limit, market, and cancel counts are sampled from Poisson distributions.
- Event side is driven by fair-value gap and current depth imbalance.
- Event level is sampled from a truncated decay distribution.
- Event size is sampled from a bounded lognormal distribution.
There are no presets, participant taxonomies, latent regimes, validation pipelines, or plotting APIs in the runtime package.
Documentation Assets
Regenerate the documentation images with:
python -m scripts.render_doc_images
More docs:
- English: docs/en/README.md
- Korean: README.ko.md
- Release process: docs/en/releasing.md
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 orderwave-0.6.0.tar.gz.
File metadata
- Download URL: orderwave-0.6.0.tar.gz
- Upload date:
- Size: 11.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f26dd9a83709de595e8e65b59253891edf1a1d52b539b923bff7350a4c30b444
|
|
| MD5 |
829d2d95fa1447a3f3133e237ee846ce
|
|
| BLAKE2b-256 |
5d408fdbb261eaffd1ee3fae8c78f46e0ae6ccfa85dba848025507c1d9530652
|
Provenance
The following attestation bundles were made for orderwave-0.6.0.tar.gz:
Publisher:
workflow.yml on smturtle2/quoteflow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
orderwave-0.6.0.tar.gz -
Subject digest:
f26dd9a83709de595e8e65b59253891edf1a1d52b539b923bff7350a4c30b444 - Sigstore transparency entry: 1089823870
- Sigstore integration time:
-
Permalink:
smturtle2/quoteflow@129b97438e04c591c481ff22239c00020807a2b1 -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/smturtle2
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@129b97438e04c591c481ff22239c00020807a2b1 -
Trigger Event:
release
-
Statement type:
File details
Details for the file orderwave-0.6.0-py3-none-any.whl.
File metadata
- Download URL: orderwave-0.6.0-py3-none-any.whl
- Upload date:
- Size: 9.9 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 |
8032ee65e10bee0c4855e06f1804dff09dc9bf379b8f0026f25053c7ebe92541
|
|
| MD5 |
9f55594dc4d0dad82d501e4102dc5e55
|
|
| BLAKE2b-256 |
aae9722437c708affec9bf084798acd78e999759cebabc8bec63ddc01c57f183
|
Provenance
The following attestation bundles were made for orderwave-0.6.0-py3-none-any.whl:
Publisher:
workflow.yml on smturtle2/quoteflow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
orderwave-0.6.0-py3-none-any.whl -
Subject digest:
8032ee65e10bee0c4855e06f1804dff09dc9bf379b8f0026f25053c7ebe92541 - Sigstore transparency entry: 1089823874
- Sigstore integration time:
-
Permalink:
smturtle2/quoteflow@129b97438e04c591c481ff22239c00020807a2b1 -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/smturtle2
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@129b97438e04c591c481ff22239c00020807a2b1 -
Trigger Event:
release
-
Statement type: