Skip to main content

Broker-neutral order-intent wire schema for a producer/consumer Redis-Streams transport

Project description

wire

A tiny, broker-neutral order-intent wire schema for a producer/consumer transport (Redis Streams or anything else). A strategy process produces OrderIntents; an executor process consumes them and reports back with ResultEvents. wire is the vendor-free contract both sides agree on: pure stdlib dataclasses with explicit JSON (de)serialisation, no broker, transport, or networking imports.

Install

pip install dollarsmore-wire
# or
uv add dollarsmore-wire
from wire import OrderIntent, ResultEvent, IntentAction, OrderType

The distribution is dollarsmore-wire; the import package is wire.

What's in it

  • OrderIntent — an order command: OPEN / CLOSE / CANCEL, 1-4 IntentLegs, order type, price (positive-magnitude Decimal) with an explicit PriceEffect (DEBIT / CREDIT), time-in-force, correlation id, strategy tag.
  • OpenBracketIntent — an entry plus a pre-staged take-profit as one OTO bracket.
  • ResultEvent — the executor's reply: ACCEPTED / REJECTED / FILLED / CANCELLED / ERROR, broker order id, fill price, detail.
  • Enums: IntentAction, LegAction, OptionType, OrderType, PriceEffect, ResultStatus.

Every type round-trips through .to_wire() / .from_wire() plain dicts, so the transport only ever moves JSON.

Versioning

WIRE_VERSION is stamped into every serialised payload (the v field). Bump it on any breaking change to the wire shape so producer and consumer can detect a mismatch.

Design rules

  • Stdlib only — no third-party dependencies, ever.
  • Money is a positive-magnitude Decimal plus an explicit PriceEffect; never a signed float.
  • Times are ISO 8601 strings on the wire; enums travel by value.

Develop

uv sync
uv run pytest -q
uv run ruff check .

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dollarsmore_wire-0.2.0.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dollarsmore_wire-0.2.0-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file dollarsmore_wire-0.2.0.tar.gz.

File metadata

  • Download URL: dollarsmore_wire-0.2.0.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for dollarsmore_wire-0.2.0.tar.gz
Algorithm Hash digest
SHA256 1787d61221fa0b9cfc7e0016a2c53244b35c1328b06f93a5184d5442431d81ac
MD5 cf06c63dc09f37c1d48915cbaaace4b4
BLAKE2b-256 c43b98de8bb5413abee886e5cdcaa25f310e2b736b83bfaf9e9e04240a167264

See more details on using hashes here.

File details

Details for the file dollarsmore_wire-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: dollarsmore_wire-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for dollarsmore_wire-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 74b6ac45a472fb6fd4d388747148c2757347b61013e2364ab9bb856a47ded566
MD5 930e0c18551a9e819d2ab6d69dab95f6
BLAKE2b-256 1c80c394343ea52b3d6450289cbcac483b06043f15c07688e64231ff0713d2a6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page