matching-engine 0.1.1__tar.gz → 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- matching_engine-0.2.0/.github/workflows/ci.yml +25 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/.github/workflows/release.yml +8 -3
- {matching_engine-0.1.1 → matching_engine-0.2.0}/CHANGELOG.md +26 -1
- {matching_engine-0.1.1 → matching_engine-0.2.0}/Dockerfile +2 -2
- matching_engine-0.2.0/LICENSE +662 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/PKG-INFO +16 -5
- {matching_engine-0.1.1 → matching_engine-0.2.0}/README.md +14 -3
- matching_engine-0.2.0/docs/adr/0005-stop-orders-and-amend.md +40 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/pyproject.toml +2 -2
- {matching_engine-0.1.1 → matching_engine-0.2.0}/requirements.txt +9 -9
- {matching_engine-0.1.1 → matching_engine-0.2.0}/src/matching_engine/__init__.py +1 -1
- {matching_engine-0.1.1 → matching_engine-0.2.0}/src/matching_engine/book.py +6 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/src/matching_engine/domain.py +25 -3
- {matching_engine-0.1.1 → matching_engine-0.2.0}/src/matching_engine/engine.py +151 -13
- {matching_engine-0.1.1 → matching_engine-0.2.0}/src/matching_engine/events.py +26 -2
- {matching_engine-0.1.1 → matching_engine-0.2.0}/src/matching_engine/gateway/app.py +29 -1
- {matching_engine-0.1.1 → matching_engine-0.2.0}/src/matching_engine/gateway/schemas.py +32 -3
- {matching_engine-0.1.1 → matching_engine-0.2.0}/src/matching_engine/wal.py +34 -8
- {matching_engine-0.1.1 → matching_engine-0.2.0}/tests/helpers.py +5 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/tests/test_gateway.py +34 -0
- matching_engine-0.2.0/tests/test_replace.py +77 -0
- matching_engine-0.2.0/tests/test_stop_orders.py +133 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/tests/test_wal.py +6 -1
- {matching_engine-0.1.1 → matching_engine-0.2.0}/uv.lock +275 -263
- matching_engine-0.1.1/.github/workflows/ci.yml +0 -43
- matching_engine-0.1.1/LICENSE +0 -21
- {matching_engine-0.1.1 → matching_engine-0.2.0}/.dockerignore +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/.gitattributes +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/.github/dependabot.yml +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/.gitignore +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/.python-version +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/CONTRIBUTING.md +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/Makefile +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/SECURITY.md +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/bench/_common.py +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/bench/bench_engine.py +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/bench/bench_gateway.py +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/bench/bench_recovery.py +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/docker-compose.yml +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/docs/adr/0001-single-threaded-engine-per-market.md +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/docs/adr/0002-wal-format-and-fsync-policy.md +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/docs/adr/0003-integer-ticks-and-lots.md +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/docs/adr/0004-python-first-with-a-rust-path.md +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/src/matching_engine/__main__.py +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/src/matching_engine/cli.py +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/src/matching_engine/gateway/__init__.py +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/src/matching_engine/gateway/config.py +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/src/matching_engine/gateway/marketdata.py +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/src/matching_engine/gateway/worker.py +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/src/matching_engine/journal.py +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/src/matching_engine/market.py +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/src/matching_engine/py.typed +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/src/matching_engine/sequencer.py +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/src/matching_engine/snapshot.py +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/src/matching_engine/workload.py +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/tests/conftest.py +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/tests/crash_writer.py +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/tests/golden/cancel_after_partial_fill.json +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/tests/golden/cancel_rejections.json +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/tests/golden/fok_reject_then_fill.json +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/tests/golden/ioc_partial_then_cancel.json +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/tests/golden/market_order_partial_then_cancel.json +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/tests/golden/partial_fill_rests_remainder.json +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/tests/golden/post_only_reject_and_rest.json +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/tests/golden/stp_cancel_both.json +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/tests/golden/stp_cancel_maker.json +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/tests/golden/stp_cancel_taker.json +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/tests/golden/sweep_levels_with_price_improvement.json +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/tests/golden/time_priority_at_one_price.json +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/tests/golden/validation_rejects.json +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/tests/test_book.py +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/tests/test_cli.py +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/tests/test_crash.py +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/tests/test_domain.py +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/tests/test_golden.py +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/tests/test_market.py +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/tests/test_marketdata.py +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/tests/test_matching.py +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/tests/test_properties.py +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/tests/test_protections.py +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/tests/test_recovery.py +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/tests/test_sequencer.py +0 -0
- {matching_engine-0.1.1 → matching_engine-0.2.0}/tests/test_time_in_force.py +0 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Runs the tests on a pull request into main — and on nothing else.
|
|
2
|
+
# The job lives once in CtrlAltDevelop/ci-workflows (python-test.yml).
|
|
3
|
+
|
|
4
|
+
name: CI
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
pull_request:
|
|
8
|
+
branches: [main]
|
|
9
|
+
|
|
10
|
+
concurrency:
|
|
11
|
+
group: ci-${{ github.ref }}
|
|
12
|
+
cancel-in-progress: true
|
|
13
|
+
|
|
14
|
+
permissions: {}
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
test:
|
|
18
|
+
name: Test
|
|
19
|
+
uses: CtrlAltDevelop/ci-workflows/.github/workflows/python-test.yml@v1.2.0
|
|
20
|
+
permissions:
|
|
21
|
+
contents: read
|
|
22
|
+
with:
|
|
23
|
+
python-version: "3.14"
|
|
24
|
+
# The gateway extra carries fastapi, which the gateway tests import.
|
|
25
|
+
install: uv sync --locked --all-extras
|
|
@@ -3,8 +3,12 @@
|
|
|
3
3
|
# =============================================================================
|
|
4
4
|
# Runs on a version tag. No API token exists anywhere: PyPI trusts this
|
|
5
5
|
# workflow's OIDC identity, configured once under the project's "Publishing"
|
|
6
|
-
# settings (owner CtrlAltDevelop, repo matching-engine, workflow
|
|
7
|
-
# environment pypi).
|
|
6
|
+
# settings (owner CtrlAltDevelop, repo matching-engine, workflow
|
|
7
|
+
# release.yml, environment pypi).
|
|
8
|
+
#
|
|
9
|
+
# The publish job lives in this file, not in the shared reusable workflow
|
|
10
|
+
# (CtrlAltDevelop/ci-workflows python-publish.yml): PyPI rejected a publish
|
|
11
|
+
# from the reusable job with `invalid-publisher` in mdp-outbox, the same setup.
|
|
8
12
|
|
|
9
13
|
name: Release
|
|
10
14
|
|
|
@@ -59,4 +63,5 @@ jobs:
|
|
|
59
63
|
path: dist/
|
|
60
64
|
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
61
65
|
with:
|
|
62
|
-
|
|
66
|
+
# Don't fail on a re-run: files PyPI already has are skipped.
|
|
67
|
+
skip-existing: true
|
|
@@ -8,6 +8,30 @@ cannot read the previous release's files is a major version.
|
|
|
8
8
|
|
|
9
9
|
## [Unreleased]
|
|
10
10
|
|
|
11
|
+
## [0.2.0] — 2026-11-26
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- Amend: `PATCH /markets/{symbol}/orders/{order_id}?account=` with a new price
|
|
16
|
+
and total remaining quantity. Lowering size at the same price keeps queue
|
|
17
|
+
position; any other change re-queues at the back and matches if it crosses.
|
|
18
|
+
New `ReplaceOrder` command and `order_replaced` event.
|
|
19
|
+
- Stop and stop-limit orders: set `stop_price` on a new order. It is parked
|
|
20
|
+
off the book until the last trade price reaches it (buy: at or above, sell:
|
|
21
|
+
at or below), then submitted in arrival order, cascading within the same
|
|
22
|
+
command. New `order_triggered` event and `pending` order status; parked
|
|
23
|
+
stops can be cancelled. See ADR 5.
|
|
24
|
+
- ADR 5, recording the stop trigger and amend decisions.
|
|
25
|
+
|
|
26
|
+
### Changed
|
|
27
|
+
|
|
28
|
+
- WAL: replace is record kind 3 and a stop order is kind 4. Existing logs
|
|
29
|
+
replay unchanged. Snapshots gain `last_trade_price` and `stops`, both
|
|
30
|
+
defaulted, so existing snapshots load. The engine state hash now covers
|
|
31
|
+
them, so hashes differ from 0.1.x.
|
|
32
|
+
- Dependencies: the python-minor group (14 updates); Docker base image
|
|
33
|
+
python 3.15-slim.
|
|
34
|
+
|
|
11
35
|
## [0.1.1] — 2026-10-15
|
|
12
36
|
|
|
13
37
|
### Fixed
|
|
@@ -51,6 +75,7 @@ cannot read the previous release's files is a major version.
|
|
|
51
75
|
- Golden, property-based, replay, crash (killed subprocess) and gateway tests;
|
|
52
76
|
engine, recovery and end-to-end benchmarks.
|
|
53
77
|
|
|
54
|
-
[Unreleased]: https://github.com/CtrlAltDevelop/matching-engine/compare/v0.
|
|
78
|
+
[Unreleased]: https://github.com/CtrlAltDevelop/matching-engine/compare/v0.2.0...HEAD
|
|
79
|
+
[0.2.0]: https://github.com/CtrlAltDevelop/matching-engine/compare/v0.1.1...v0.2.0
|
|
55
80
|
[0.1.1]: https://github.com/CtrlAltDevelop/matching-engine/compare/v0.1.0...v0.1.1
|
|
56
81
|
[0.1.0]: https://github.com/CtrlAltDevelop/matching-engine/releases/tag/v0.1.0
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# syntax=docker/dockerfile:1
|
|
2
|
-
FROM python:3.
|
|
2
|
+
FROM python:3.15-slim AS build
|
|
3
3
|
COPY --from=ghcr.io/astral-sh/uv:0.12 /uv /usr/local/bin/uv
|
|
4
4
|
WORKDIR /app
|
|
5
5
|
ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy
|
|
@@ -9,7 +9,7 @@ RUN uv sync --frozen --no-dev --extra gateway --no-install-project
|
|
|
9
9
|
COPY src ./src
|
|
10
10
|
RUN uv sync --frozen --no-dev --extra gateway --no-editable
|
|
11
11
|
|
|
12
|
-
FROM python:3.
|
|
12
|
+
FROM python:3.15-slim
|
|
13
13
|
RUN useradd --system --uid 10001 --home-dir /nonexistent engine \
|
|
14
14
|
&& mkdir /data && chown engine /data
|
|
15
15
|
COPY --from=build /app/.venv /app/.venv
|