{"id":51618034,"url":"https://github.com/wickra-lib/wickra-exchange","last_synced_at":"2026-07-12T16:01:27.254Z","repository":{"id":368759188,"uuid":"1285545072","full_name":"wickra-lib/wickra-exchange","owner":"wickra-lib","description":"Streaming-native crypto-exchange connectivity built on the Wickra core: one typed, unified API over the ten largest exchanges, across 8 languages.","archived":false,"fork":false,"pushed_at":"2026-07-09T13:18:22.000Z","size":982,"stargazers_count":2,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-09T15:10:22.608Z","etag":null,"topics":["algorithmic-trading","binance","bybit","crypto-exchange","cryptocurrency","derivatives","exchange-api","fintech","futures","kraken","market-data","nodejs","okx","order-execution","python","rust","streaming","trading","trading-bot","websocket"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wickra-lib.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE-APACHE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":"THREAT_MODEL.md","audit":null,"citation":"CITATION.cff","codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":"SUPPORT.md","governance":"GOVERNANCE.md","roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":"MAINTAINERS.md","copyright":null,"agents":null,"dco":"DCO","cla":null},"funding":{"github":["kingchenc"]}},"created_at":"2026-06-30T23:14:21.000Z","updated_at":"2026-07-09T13:18:34.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/wickra-lib/wickra-exchange","commit_stats":null,"previous_names":["wickra-lib/wickra-exchange"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wickra-lib/wickra-exchange","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wickra-lib%2Fwickra-exchange","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wickra-lib%2Fwickra-exchange/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wickra-lib%2Fwickra-exchange/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wickra-lib%2Fwickra-exchange/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wickra-lib","download_url":"https://codeload.github.com/wickra-lib/wickra-exchange/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wickra-lib%2Fwickra-exchange/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35395749,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-12T02:00:06.386Z","response_time":87,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithmic-trading","binance","bybit","crypto-exchange","cryptocurrency","derivatives","exchange-api","fintech","futures","kraken","market-data","nodejs","okx","order-execution","python","rust","streaming","trading","trading-bot","websocket"],"created_at":"2026-07-12T16:01:26.386Z","updated_at":"2026-07-12T16:01:27.248Z","avatar_url":"https://github.com/wickra-lib.png","language":"Rust","funding_links":["https://github.com/sponsors/kingchenc"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://wickra.org\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/wickra-lib/.github/main/profile/wickra-banner.webp?v=514\" alt=\"Wickra — streaming-first technical indicators\" width=\"100%\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n[![Built on Wickra](https://img.shields.io/badge/built%20on-wickra-3b82f6)](https://github.com/wickra-lib/wickra)\n[![Status](https://img.shields.io/badge/status-pre--alpha%20(scaffolding)-red)](https://github.com/wickra-lib/wickra-exchange)\n[![CI](https://raw.githubusercontent.com/wickra-lib/.github/main/profile/badges/wickra-exchange/ci.svg)](https://github.com/wickra-lib/wickra-exchange/actions/workflows/ci.yml)\n[![CodeQL](https://raw.githubusercontent.com/wickra-lib/.github/main/profile/badges/wickra-exchange/codeql.svg)](https://github.com/wickra-lib/wickra-exchange/actions/workflows/codeql.yml)\n[![codecov](https://raw.githubusercontent.com/wickra-lib/.github/main/profile/badges/wickra-exchange/codecov.svg)](https://codecov.io/gh/wickra-lib/wickra-exchange)\n[![License: MIT OR Apache-2.0](https://raw.githubusercontent.com/wickra-lib/.github/main/profile/badges/wickra-exchange/license.svg)](#license)\n[![OpenSSF Scorecard](https://raw.githubusercontent.com/wickra-lib/.github/main/profile/badges/wickra-exchange/scorecard.svg)](https://scorecard.dev/viewer/?uri=github.com/wickra-lib/wickra-exchange)\n[![OpenSSF Best Practices](https://raw.githubusercontent.com/wickra-lib/.github/main/profile/badges/wickra-exchange/best-practices.svg)](https://www.bestpractices.dev/)\n[![Build provenance](https://raw.githubusercontent.com/wickra-lib/.github/main/profile/badges/wickra-exchange/provenance.svg)](https://github.com/wickra-lib/wickra-exchange/attestations)\n[![Docs](https://raw.githubusercontent.com/wickra-lib/.github/main/profile/badges/wickra-exchange/docs.svg)](https://wickra.org)\n[![Verified across 8 languages](https://raw.githubusercontent.com/wickra-lib/.github/main/profile/badges/wickra-exchange/verified.svg)](golden/)\n[![Live demo](https://img.shields.io/badge/live%20demo-live.wickra.org-3b82f6)](https://live.wickra.org)\n\n---\n\n**One typed API. Ten exchanges. Eight languages.** Streaming-native crypto-exchange\nconnectivity — market data *and* signed order execution — built on the\n[Wickra](https://github.com/wickra-lib/wickra) core.\n\n\u003e **▶ Live demo:** all 514 indicators over real Binance market data, computed live in your browser — **[live.wickra.org](https://live.wickra.org)** · zero backend, powered by `wickra-wasm`.\n\n\u003e **Part of the [Wickra ecosystem](https://github.com/wickra-lib):** the same data-driven core and ten-language binding surface also power [wickra-exchange](https://github.com/wickra-lib/wickra-exchange), [wickra-backtest](https://github.com/wickra-lib/wickra-backtest), [wickra-terminal](https://github.com/wickra-lib/wickra-terminal), [wickra-screener](https://github.com/wickra-lib/wickra-screener), [wickra-xray](https://github.com/wickra-lib/wickra-xray), [wickra-radar](https://github.com/wickra-lib/wickra-radar), [wickra-copilot](https://github.com/wickra-lib/wickra-copilot) and [wickra-shazam](https://github.com/wickra-lib/wickra-shazam).\n\nA single, compile-time-typed `Exchange` trait spans the ten largest venues\n(Binance, OKX, Bybit, Coinbase, Upbit, Bitget, Gate.io, Kraken, KuCoin, HTX)\nbehind bespoke authentication and WebSocket state machines. Market-data streams\nare **pull-based** (`poll_events`), so the same surface crosses the C ABI to\nevery binding — including single-threaded R — as trivially as a synchronous\ncall. Quantities in the order layer are exact [`Decimal`], never `f64`.\n\nWhat makes it more than \"a typed ccxt\" is that it **plugs straight into the rest\nof Wickra**:\n\n- **`PaperExchange`** — a first-class `Exchange` implementation that simulates\n  fills through the [wickra-backtest](https://github.com/wickra-lib/wickra-backtest)\n  engine. The *same* strategy runs paper ↔ live by swapping the implementation.\n- **Microstructure-native feeds** — funding, open interest, liquidations and\n  long/short ratio arrive as the exact typed shapes `wickra-core` consumes\n  (`DerivativesTick`, `OrderBook`, `TradePrint`, `CrossSection`), feeding 514\n  indicators and the backtester with zero glue.\n- **`ReplayExchange`** — a recorded feed driven through the same trait, so a\n  backtest runs on *real* recorded microstructure.\n\nThe same `Exchange` API is reachable from **Rust, Python, Node.js, C, C++, C#,\nGo, Java and R** — native PyO3 / napi bindings plus a C ABI hub. There is no WASM\nbinding: authenticated trading needs raw sockets and secret keys, which a browser\nsandbox forbids (the browser-safe slice — public market data — is already covered\nby `wickra-wasm` over a browser WebSocket).\n\n[`Decimal`]: https://docs.rs/rust_decimal\n\n## Status\n\n**Pre-alpha — scaffolding.** This repository is being built out from the\n[`wickra-backtest`](https://github.com/wickra-lib/wickra-backtest) template. The\nworkspace, the core crate and the project governance are in place; the exchange\nimplementations, the connectivity machinery and the language bindings are landing\nincrementally. **The API shown below is the target surface, not yet shippable.**\nTrack progress in [ROADMAP.md](ROADMAP.md). Not released to any registry.\n\n\u003e ⚠️ **Real orders move real money.** Every signed-execution code path is\n\u003e safety-critical. Use withdrawal-disabled keys, test against exchange testnets\n\u003e first, and never put secret keys in a browser or client.\n\n## Documentation\n\n- **[Exchanges](docs/EXCHANGES.md)** — the ten venues, their market types and the\n  per-exchange capability matrix.\n- **[Authentication](docs/AUTH.md)** — the signing families (HMAC-SHA256/512,\n  JWT ES256/HS512, passphrase) and how `Credentials` map onto each.\n- **[Streaming](docs/STREAMING.md)** — the pull-based event model, the local\n  order-book builder and reconnect/resubscribe semantics.\n- **[Derivatives \u0026 advanced orders](docs/DERIVATIVES.md)** — the `Derivatives`,\n  `AdvancedOrders`, `WsUserData` and `WsExecution` traits, futures routing, and\n  per-venue gaps.\n- **[Capability matrix](docs/CAPABILITIES.md)** — real per-venue support for\n  spot/futures, positions/leverage/margin, and STP/amend/batch/OCO/WS-order.\n- **[Architecture](ARCHITECTURE.md)** — crates, traits, the transport abstraction\n  and design decisions.\n- **[Benchmarks](BENCHMARKS.md)** — signing / parse / filter-rounding throughput.\n- **[Examples](examples/)** — one runnable program per language.\n\n## Quickstart\n\nConnect, read a ticker, subscribe to a pull-based stream, and place an order on a\ntestnet:\n\n```rust\nuse wickra_exchange::{Exchange, Credentials, ExchangeOptions, MarketType, OrderRequest};\n\nlet creds = Credentials::new(\"api-key\", \"api-secret\");\nlet opts = ExchangeOptions::testnet(MarketType::Spot);\nlet mut ex = Exchange::new(\"binance\", creds, opts)?;\n\n// REST: a typed ticker.\nlet ticker = ex.ticker(\"BTC/USDT\")?;\nprintln!(\"last = {}\", ticker.last);\n\n// Streaming: subscribe, then drain events from your own loop (pull, not callbacks).\nex.subscribe_trades(\"BTC/USDT\")?;\nfor event in ex.poll_events() {\n    println!(\"{event:?}\");\n}\n\n// Signed execution (testnet) with exact Decimal price/qty.\nlet order = OrderRequest::limit_buy(\"BTC/USDT\", \"0.001\".parse()?, \"20000\".parse()?);\nlet placed = ex.place_order(\u0026order)?;\nprintln!(\"order id = {}\", placed.id);\n```\n\nThe same flow is available from every binding — see the per-language quickstarts\nbelow.\n\n## Exchanges\n\nThe ten largest venues by volume, each behind the same `Exchange` trait. The\n*signing family* drives the per-exchange authentication; everything above it\n(symbols, order types, the order-book builder, reconnect) is shared.\n\n| #  | Exchange | Spot | USDⓈ-M | COIN-M | Signing family |\n|----|----------|:----:|:------:|:------:|----------------|\n| 1  | Binance  | ✅ | ✅ | ⏳ | HMAC-SHA256 (query string), Ed25519 optional |\n| 2  | OKX      | ✅ | ✅ | ⏳ | HMAC-SHA256 (ts+method+path+body, b64) + passphrase |\n| 3  | Bybit    | ✅ | ✅ | ⏳ | HMAC-SHA256 (ts+key+recvWindow+payload) |\n| 4  | Coinbase | ✅ | — | — | JWT ES256 / Ed25519 per request |\n| 5  | Upbit    | ✅ | — | — | JWT HS512 + SHA512 query hash |\n| 6  | Bitget   | ✅ | ✅ | ⏳ | HMAC-SHA256 (b64) + passphrase |\n| 7  | Gate.io  | ✅ | ✅ | ⏳ | HMAC-SHA512 (SHA512 payload hash) |\n| 8  | Kraken   | ✅ | ⏳ | — | HMAC-SHA512 (URI + SHA256(nonce+body)), b64 secret |\n| 9  | KuCoin   | ✅ | ⏳ | — | HMAC-SHA256 (b64) + signed passphrase |\n| 10 | HTX      | ✅ | ⏳ | — | HMAC-SHA256 AWS-style (method+host+path+sorted) |\n\n✅ implemented · ⏳ planned · — not offered by the venue. The current state of\neach cell is tracked in [docs/EXCHANGES.md](docs/EXCHANGES.md).\n\n## Use the same API in any language\n\n| Language | Binding | Quickstart |\n|----------|---------|------------|\n| Rust     | `wickra-exchange` crate | this README |\n| Python   | PyO3 / maturin | [bindings/python](bindings/python/README.md) |\n| Node.js  | napi-rs | [bindings/node](bindings/node/README.md) |\n| C / C++  | C ABI (cbindgen) | [bindings/c](bindings/c/README.md) |\n| C#       | P/Invoke | [bindings/csharp](bindings/csharp/README.md) |\n| Go       | cgo | [bindings/go](bindings/go/README.md) |\n| Java     | FFM / Panama | [bindings/java](bindings/java/README.md) |\n| R        | `.Call` | [bindings/r](bindings/r/README.md) |\n\nThe C, C++, C#, Go, Java and R bindings all call through the same C ABI hub. The\n[replay corpus](golden/) asserts every language normalises recorded exchange\nresponses into byte-identical typed structs.\n\n## Project layout\n\n```\nwickra-exchange/\n├── crates/\n│   ├── wickra-exchange-core/   traits + types (Decimal) + credentials + the\n│   │                           connectivity machinery (symbol, clock, ratelimiter,\n│   │                           orderbook builder, transport, ws, reconcile, feeds)\n│   │                           and the per-exchange implementations\n│   ├── wickra-exchange/        facade crate (re-exports the public surface)\n│   ├── wickra-exchange-cli/    the `wkex` command-line client\n│   └── wickra-exchange-bench/  criterion signing / parse / filter benchmarks\n├── bindings/\n│   ├── python/   PyO3 + maturin          ├── csharp/  P/Invoke over the C ABI\n│   ├── node/     napi-rs                 ├── go/      cgo over the C ABI\n│   ├── c/        C ABI (cdylib + header) ├── java/    FFM over the C ABI\n│   └── r/        .Call over the C ABI\n├── golden/       recorded-response replay corpus + expected normalised structs\n├── examples/     one runnable program per language\n├── docs/         exchanges, auth, streaming and architecture guides\n└── fuzz/         cargo-fuzz targets (nightly)\n```\n\nThere is no `bindings/wasm/` — see the intro for why.\n\n## Building from source\n\n```bash\n# Rust core + tests + lints\ncargo test --workspace --all-features\ncargo clippy --workspace --all-targets --all-features -- -D warnings\ncargo bench -p wickra-exchange-bench\n\n# Python binding (requires a Rust toolchain + maturin)\ncd bindings/python \u0026\u0026 maturin develop --release \u0026\u0026 pytest\n\n# Node binding (requires @napi-rs/cli)\ncd bindings/node \u0026\u0026 npm install \u0026\u0026 npm run build \u0026\u0026 npm test\n\n# C ABI (cdylib + staticlib + generated header)\ncargo build -p wickra-exchange-c --release\n\n# C# binding (requires the .NET 8 SDK; links the C ABI above)\ndotnet test bindings/csharp/WickraExchange.Tests/WickraExchange.Tests.csproj\n\n# Go binding (requires a C compiler for cgo; links the C ABI above)\ncd bindings/go \u0026\u0026 go test ./...\n\n# Java binding (requires JDK 22+ and Maven; links the C ABI above)\nmvn -f bindings/java test\n\n# R binding (requires a C toolchain / Rtools; links the C ABI above)\nWKEX_INC=\"$PWD/bindings/c/include\" WKEX_LIB=\"$PWD/target/debug\" R CMD INSTALL bindings/r\n```\n\nIntegration tests that hit a live exchange run only against **testnets**, are\ngated behind environment variables and are `#[ignore]` by default — they never\ntouch mainnet with real keys. Fuzzing requires a nightly toolchain — see\n[`fuzz/`](fuzz/).\n\n## Requirements\n\nThe minimum supported version per language. The same Rust core runs behind every\nbinding; the C-ABI bindings that compile on install — Go (cgo) and R (`.Call`) —\nalso need a C compiler, and Java runs with `--enable-native-access=ALL-UNNAMED`.\n\n| Language | Package                                    | Minimum supported          |\n|----------|--------------------------------------------|----------------------------|\n| Rust     | crates.io · `wickra-exchange`              | 1.86 (MSRV)                |\n| Python   | PyPI · `wickra-exchange` (abi3 wheel)      | 3.9 (tested through 3.13)  |\n| Node.js  | npm · `wickra-exchange` (N-API 8)          | 22 (tested on 22 · 24 LTS) |\n| C        | `wickra_exchange.h` + library (releases)   | C99 compiler               |\n| C++      | over the C ABI                             | C++14 compiler             |\n| C#       | NuGet · `WickraExchange`                    | .NET 8 (`net8.0`)          |\n| Go       | module · `wickra-lib/wickra-exchange-go`   | Go 1.23 (cgo)              |\n| Java     | Maven Central · `org.wickra:wickra-exchange` | Java 22 (FFM / Panama)   |\n| R        | r-universe · `wickraexchange`              | R ≥ 2.10 (Rtools on Win.)  |\n\n## Ecosystem\n\nPart of the [Wickra](https://github.com/wickra-lib/wickra) family — each one a\ndata-driven core with a CLI and the same ten-language binding surface:\n\n- [**wickra**](https://github.com/wickra-lib/wickra) — the core library: 514 O(1) streaming indicators across ten languages\n- [**wickra-exchange**](https://github.com/wickra-lib/wickra-exchange) — unified market-data + execution across ten crypto exchanges\n- [**wickra-backtest**](https://github.com/wickra-lib/wickra-backtest) — event-driven backtester over the Wickra core\n- [**wickra-terminal**](https://github.com/wickra-lib/wickra-terminal) — the trading terminal: a TUI and a browser renderer over the stack\n- [**wickra-screener**](https://github.com/wickra-lib/wickra-screener) — parallel multi-symbol screening over 514 streaming indicators\n- [**wickra-xray**](https://github.com/wickra-lib/wickra-xray) — market-microstructure explorer: footprint, order-book heatmap, liquidation map, funding/OI divergence\n- [**wickra-radar**](https://github.com/wickra-lib/wickra-radar) — perp-universe alert radar: OI delta, funding flip, book imbalance, liquidation clusters, OI/price divergence\n- [**wickra-copilot**](https://github.com/wickra-lib/wickra-copilot) — local market copilot grounded in real order-book, liquidation and funding microstructure\n- [**wickra-shazam**](https://github.com/wickra-lib/wickra-shazam) — match an asset's current microstructure fingerprint against its entire history\n\nDocs at [docs.wickra.org](https://docs.wickra.org); the marketing site and\nin-browser demo at [wickra.org](https://wickra.org).\n\n## Contributing\n\nContributions are welcome — issues, bug reports, ideas and pull requests all land\nat \u003chttps://github.com/wickra-lib/wickra-exchange\u003e. See\n[CONTRIBUTING.md](CONTRIBUTING.md) for the orientation: the core lives in\n`crates/wickra-exchange-core`, every binding under `bindings/\u003clang\u003e` keeps the\nreplay-parity invariant, and `cargo fmt --all` +\n`cargo clippy --workspace --all-targets --all-features -- -D warnings` are CI\ngates. For larger changes, open an issue first.\n\n## Security\n\nFound a security issue? **Please don't open a public issue.** Report it privately\nvia the repository's *Security* tab (*\"Report a vulnerability\"*) or email\n**support@wickra.org**. Full policy: [SECURITY.md](SECURITY.md). The handling of\nsecret key material is documented in [THREAT_MODEL.md](THREAT_MODEL.md).\n\n## License\n\nLicensed under either of\n\n- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or\n  \u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e)\n- MIT license ([LICENSE-MIT](LICENSE-MIT) or \u003chttp://opensource.org/licenses/MIT\u003e)\n\nat your option. Use it, fork it, modify it, redistribute it — commercially or\nnot — file issues, send pull requests; all welcome.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n\n## Disclaimer\n\nNot a trading system and not financial advice. This library connects to exchanges\nand can place real orders that risk real capital; any such use is **entirely at\nyour own risk**. Authentication, order rounding, reconnect handling and rate\nlimiting can fail in ways that lose money — test against testnets, use\nwithdrawal-disabled keys, and review the code before trading. The software is\nprovided **as is**, without warranty of any kind; see the license files for the\nfull terms.\n\n---\n\n\u003cp align=\"center\"\u003e\n  Built on \u003ca href=\"https://github.com/wickra-lib/wickra\"\u003eWickra\u003c/a\u003e. If it saved you time, ⭐ the repo.\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwickra-lib%2Fwickra-exchange","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwickra-lib%2Fwickra-exchange","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwickra-lib%2Fwickra-exchange/lists"}