Skip to main content

Wickra Synth — deterministic synthetic market microstructure: OHLCV, order book, trades and funding from a single seed, byte-identical across ten languages

Built on Wickra Status CI CodeQL codecov GitHub release crates.io PyPI npm NuGet Maven Central Go module R-universe License: MIT OR Apache-2.0 OpenSSF Scorecard OpenSSF Best Practices Build provenance Docs Verified across 10 languages


Deterministic synthetic market microstructure — OHLCV, order book, trades and funding from a single seed, byte-identical across ten languages.

▶ Live demos: the backtester compiled to WebAssembly, an equity curve building bar by bar — backtest-live.wickra.org; one StrategySpec side by side in Python, Rust, JS and Go — playground.wickra.org; all 515 indicators of the core over a real Binance feed — live.wickra.org. Zero backend, all of them.

Part of the Wickra ecosystem: the same data-driven core and ten-language binding surface also power wickra-exchange, wickra-backtest, wickra-terminal and 20 more — see the full list.

Wickra Synth is one data-driven core, wickra-synth-core: a serde GenSpec describes a market regime, a fixed portable PRNG (SplitMix64 seeding xoshiro256++) drives it, and the core emits OHLCV candles plus order-book snapshots, trades and funding samples — realistic synthetic microstructure for tests, training and demos. Because the RNG lives only in the Rust core and is portable-deterministic, a given seed yields the byte-for-byte identical stream on every platform and through every language binding. The output mirrors the JSON shapes of the rest of the ecosystem, so it drops straight into backtests, screeners and RL environments.

Because the spec is data, not code, the exact same generation crosses the C ABI and WASM unchanged. The core is exposed as a JSON-over-C-ABI data API (Synth::command_json) in Rust, Python, Node.js, WASM, C, C++, C#, Go, Java and R, so a developer in any language draws the same synthetic market.

use wickra_synth_core::{generate, GenSpec};

// A spec is data: a seed, a length, and the regimes the price path walks
// through. Nothing else is random, so the same seed draws the same market
// on every platform and through every binding.
let spec = GenSpec::from_json(spec_json)?;
let out = generate(&spec)?;
println!("{} candles, {} trades", out.candles.len(), out.trades.len());

// Replaying the seed replays the bytes -- that is the whole contract.
assert_eq!(generate(&spec)?, out);

The same generation from the command line:

cargo install wickra-synth
wickra-synth --seed 42 --bars 20 --format json

Status

0.2.3 — the current release. The core, the reference CLI, the ten-language binding surface, the golden corpus and the full CI matrix are in place; the generation model and command protocol are pinned by golden tests.

Documentation

  • ARCHITECTURE.md — workspace layout and the core-only-randomness design.
  • GENSPEC.md — the input specification, its fields and every validation rule.
  • PROTOCOL.md — the command_json boundary all ten bindings forward to.
  • REGIMES.md — the trend / range / crash / vol price-path formulas.
  • MICROSTRUCTURE.md — order book, trades and funding.
  • DETERMINISM.md — the PRNG and the fixed draw-order contract.
  • Cookbook.md — practical recipes.

Quickstart

cargo install wickra-synth
wickra-synth --seed 42 --bars 20 --format json

Twenty bars of OHLCV, an order book, trades and funding, from nothing but the number 42 — and the same twenty bars on every platform and in every one of the ten languages below. The spec that shaped them is JSON, so the same seed and spec reproduce the same market from any binding.

Use in any language

Every binding forwards the same command_json string to the Rust core, so all ten draw byte-identical synthetic markets for a given seed.

from wickra_synth import Synth
import json

synth = Synth('{"seed":42,"bars":20,"start_price":100.0,'
              '"regimes":[{"kind":"trend","len":20,"drift":0.002,"vol":0.01}],'
              '"microstructure":{"book_depth":5,"spread_bps":4.0,"trade_rate":8.0}}')
out = json.loads(synth.command('{"cmd":"generate"}'))
print(len(out["candles"]))  # 20

Runnable examples for all ten languages — each printing the same first three candles — live in examples/.

Project layout

crates/synth-core     the engine: GenSpec, the PRNG, the walk, the microstructure
crates/synth-cli      wickra-synth, the reference consumer
crates/synth-bench    criterion benchmarks
bindings/c            the C ABI hub (cdylib + staticlib) plus the C++ hull
bindings/python       PyO3 / maturin, abi3-py39
bindings/node         napi-rs, per-platform npm packages
bindings/wasm         wasm-bindgen
bindings/csharp       P/Invoke over the hub
bindings/go           cgo over the hub
bindings/java         Foreign Function & Memory API over the hub
bindings/r            .Call glue over the hub
golden/               specs + blessed outputs, the cross-language contract
examples/             one runnable example per language
fuzz/                 cargo-fuzz targets for parse, generate, PRNG and FFI
docs/                 the deep dives; see docs/README.md

Six of the ten reaches go through one C ABI (bindings/c), which is why there is exactly one place a marshalling bug can live rather than six.

Building everything from source

The core and the CLI need only cargo:

cargo build --workspace
cargo test  --workspace

The bindings each need their own toolchain, and the six that go through the C ABI need it built first:

cargo build --release -p wickra-synth-c          # the hub the six link against

cd bindings/python && maturin develop --release  # Python
cd bindings/node   && npm install && npx napi build --platform --release
cd bindings/wasm   && wasm-pack build --target nodejs
dotnet build bindings/csharp/WickraSynth -c Release
mvn -f bindings/java package
R CMD INSTALL bindings/r                         # WKSYNTH_INC/WKSYNTH_LIB, see below
cmake -S examples/c -B examples/c/build && cmake --build examples/c/build

The R binding downloads a matching prebuilt C ABI by default. To build it against the one in your tree instead, set WKSYNTH_INC to bindings/c/include and WKSYNTH_LIB to target/release.

Testing

cargo test --workspace --all-features
cargo test --workspace --no-default-features

Beyond the unit tests, four suites are worth knowing about:

  • Golden — every binding replays golden/specs and must reproduce golden/expected byte for byte. That is the cross-language guarantee, and it is checked in all ten reaches, not asserted in the README.
  • RNG vectors — fixed SplitMix64 and xoshiro256++ reference values. If these move, every seed in the world moves with them.
  • Stream equals batch — the reassembled event stream equals the batch output, so the two paths cannot drift apart.
  • Property tests — random specs stay finite and well formed, and the same seed gives the same bytes.

Per-binding commands are in CONTRIBUTING.md; the scripts/check_*.py family holds the version, licence, link and binding-surface invariants that no compiler checks.

Requirements

The core needs nothing but a Rust toolchain — no system libraries, no BLAS, no Python at build time. Each binding adds only its own runtime:

Reach Floor Where it is declared
Rust (workspace) 1.86 Cargo.toml, rust-version
Rust (Node binding build) 1.88 bindings/node/Cargo.toml — napi-build needs it
Python 3.9 bindings/python/pyproject.toml, requires-python (abi3)
Node.js 22 bindings/node/package.json, engines.node
.NET 8.0 bindings/csharp/WickraSynth/WickraSynth.csproj
Go 1.23 bindings/go/go.mod
Java 22 bindings/java/pom.xml — the Foreign Function & Memory API
R 4.1 bindings/r/DESCRIPTION, Depends

scripts/check_version_sync.py holds these numbers against the manifests, so a floor that moves in one place and not the other is a failing check rather than a support question.

Benchmarks

Per-generation throughput is tracked in BENCHMARKS.md and measured by the synth-bench crate (cargo bench -p synth-bench). A shallow book with light trade flow generates roughly 4.3 million candles per second; the microstructure, not the price walk, is what the time goes on.

Ecosystem

Wickra Synth is one repository in a family that shares a core and a ten-language binding surface:

  • wickra — 515 streaming indicators, the core everything else is built on.
  • wickra-backtest — a streaming-native backtester where backtest and live are the same code path.
  • wickra-screener — scan thousands of symbols against data-driven conditions.
  • wickra-exchange — one typed API over the ten largest crypto exchanges.
  • wickra-terminal — a streaming trading terminal over the same core.

Synth is the one that needs no market data at all: it is where the others get a reproducible market to test against. The full list is at github.com/wickra-lib.

Contributing

See CONTRIBUTING.md.

Security

See SECURITY.md and THREAT_MODEL.md. Note the PRNG is a fast non-cryptographic generator for reproducible simulation — it is not suitable for any security or cryptographic purpose.

License

Licensed under either of

at your option. Use it, fork it, modify it, redistribute it — commercially or not — file issues, send pull requests; all welcome.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Disclaimer

wickra-synth generates synthetic market data for testing, training and demonstration. It is not real market data and is not financial advice; it comes with no warranty.


GitHub stars GitHub forks GitHub issues

Built on Wickra. If it saved you time, the cheapest way to say thanks is to ⭐ the repo.

wickra-synth star history

Metadata

Release files for wickra-synth 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wickra-synth 0.2.3
File Size Uploaded Provenance Actions
wickra_synth-0.2.3.tar.gz 63.2 kB Without provenance Details for wickra_synth-0.2.3.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for wickra-synth 0.2.3
File Actions
wickra_synth-0.2.3-cp39-abi3-win_arm64.whl CPython 3.9 abi3 Windows ARM64 Details for wickra_synth-0.2.3-cp39-abi3-win_arm64.whl
wickra_synth-0.2.3-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for wickra_synth-0.2.3-cp39-abi3-win_amd64.whl
wickra_synth-0.2.3-cp39-abi3-musllinux_1_2_x86_64.whl CPython 3.9 abi3 Linux musl 1.2+ x86-64 Details for wickra_synth-0.2.3-cp39-abi3-musllinux_1_2_x86_64.whl
wickra_synth-0.2.3-cp39-abi3-musllinux_1_2_aarch64.whl CPython 3.9 abi3 Linux musl 1.2+ ARM64 Details for wickra_synth-0.2.3-cp39-abi3-musllinux_1_2_aarch64.whl
wickra_synth-0.2.3-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details for wickra_synth-0.2.3-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
wickra_synth-0.2.3-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for wickra_synth-0.2.3-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
wickra_synth-0.2.3-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for wickra_synth-0.2.3-cp39-abi3-macosx_11_0_arm64.whl
wickra_synth-0.2.3-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details for wickra_synth-0.2.3-cp39-abi3-macosx_10_12_x86_64.whl

Total release size: 2.5 MB

Release files / wickra_synth-0.2.3.tar.gz

Download URL wickra_synth-0.2.3.tar.gz
Size 63.2 kB
Tags Source
SHA-256 checksum
How to use checksums
135071bae9b1abda3b99a3dc0bbfc0a2aa1d70afb75920a3afe21ccd8f0d5503
BLAKE2b-256 checksum
How to use checksums
c213023f6338ffcf54ff1be84773014c540a6985a63bfdd07d7345023c63d93e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / wickra_synth-0.2.3-cp39-abi3-win_arm64.whl

Download URL wickra_synth-0.2.3-cp39-abi3-win_arm64.whl
Size 181.5 kB
Tags CPython 3.9 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
eaa176176188973c4566353ecd149beefac7dc1e6700f813cc965fcc9185a178
BLAKE2b-256 checksum
How to use checksums
f77118b05743c4c257abb6e2b64c8fd45293a2e9f8bbf882a1f48077dd1995c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / wickra_synth-0.2.3-cp39-abi3-win_amd64.whl

Download URL wickra_synth-0.2.3-cp39-abi3-win_amd64.whl
Size 192.5 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
c7e6f43bc24bf1b732307b9ca12c0c97d0951109b52537da5e784807d214cb70
BLAKE2b-256 checksum
How to use checksums
9613c9eee88682d49dfed58c91e5cb5d679559052b13a4c53236fca6c97309a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / wickra_synth-0.2.3-cp39-abi3-musllinux_1_2_x86_64.whl

Download URL wickra_synth-0.2.3-cp39-abi3-musllinux_1_2_x86_64.whl
Size 498.0 kB
Tags CPython 3.9 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
da36d57a30bec4a93463d4c2010b174b07fc8c9e2676c666b486171ed2c85f90
BLAKE2b-256 checksum
How to use checksums
0eecaa27b6d2792f51686c5439967a74000074d328c6c3fd6fc21ecae9cd72e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / wickra_synth-0.2.3-cp39-abi3-musllinux_1_2_aarch64.whl

Download URL wickra_synth-0.2.3-cp39-abi3-musllinux_1_2_aarch64.whl
Size 448.9 kB
Tags CPython 3.9 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
3140e3078f2178dbcfddea30869ce2b1430920fdd4352e41178a2e5a7239b008
BLAKE2b-256 checksum
How to use checksums
9f8be7f3a90118b7e541d917897d9579d1140e24a71272aa2213443c48c2f5bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / wickra_synth-0.2.3-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL wickra_synth-0.2.3-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 286.1 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
4195c8185e4608e5195494e1c7f3cd3dfc5a2bf1c9fe5c45d4e8503dfeb7fc43
BLAKE2b-256 checksum
How to use checksums
84168276b3c6aee9dae859ebec264c08ff1ca643e77abd4d7c17f0d7d005d14d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / wickra_synth-0.2.3-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL wickra_synth-0.2.3-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 270.1 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
a71588286143fc7afcb9ea636e28faf4ccd27a5b618107344b04e7bb1738b545
BLAKE2b-256 checksum
How to use checksums
2fcd01735f0eeb14b1e099bb95929000f0ce7ac0b71bd493983092dabce5a841
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / wickra_synth-0.2.3-cp39-abi3-macosx_11_0_arm64.whl

Download URL wickra_synth-0.2.3-cp39-abi3-macosx_11_0_arm64.whl
Size 256.6 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
7bcce688fa5cabdbcf6b2beaa34fdd4127ed3de026aeee08f76ca0397c4074d2
BLAKE2b-256 checksum
How to use checksums
08cd7fd31a95efc1b9c11e4ad8659364ab13f9ce09af5cb77cf79ba260e8d1bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / wickra_synth-0.2.3-cp39-abi3-macosx_10_12_x86_64.whl

Download URL wickra_synth-0.2.3-cp39-abi3-macosx_10_12_x86_64.whl
Size 275.7 kB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
a0d7b5685455d93ed2f1bda51691624d30a2d1a8d0256569c65738f28ce4f032
BLAKE2b-256 checksum
How to use checksums
98c117b80cee1ea6a8d4ca5da4e3b7c4fa0ae321d84d57068ef0e068012111fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for wickra-synth 0.2.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page