Canonical reference data for Money Ex Machina.
Project description
mxm-refdata
Reference data and contract ontology for the Money Ex Machina (MXM) ecosystem.
mxm-refdata provides canonical, programmatic definitions of financial instruments and trading structures, currently focused on:
- futures products,
- futures contracts,
- lifecycle rules,
- trading calendars,
- periods and period cycles,
- and deterministic contract generation.
The package acts as the ontological reference layer for MXM systems such as mxm-v1.
Purpose
mxm-refdata defines what financial reference objects exist and how they are constructed.
For example, a futures contract such as:
cme_gbp_futures.Mar-2032
is treated as a deterministic construct derived from:
- product specifications,
- listing rules,
- period systems,
- and trading-calendar semantics.
This allows MXM systems to reason about financial structures independently of any specific market-data provider.
mxm-refdata therefore models the constructive ontology of financial instruments, while observed prices, trades, quotes, and exchange events belong to the separate market-observation layer (mxm-marketdata).
Architecture
mxm-refdata consists of four main layers:
-
Reference specifications
Human-authored product and lifecycle specifications bundled with the package. -
Deterministic generation
Services that construct contracts, periods, lifecycle dates, and calendar relationships. -
Materialised reference store
SQLite database containing generated products, contracts, periods, cycles, and lifecycle state. -
Query and inspection interfaces
Typed Python API and operational CLI.
Installation
git clone https://github.com/moneyexmachina/mxm-refdata.git
cd mxm-refdata
poetry install
Usage
Build the local reference database:
mxm-refdata build
Rebuild from scratch:
mxm-refdata rebuild
Inspect products:
mxm-refdata products
Inspect contract coverage:
mxm-refdata coverage
Run operational smoke checks:
mxm-refdata smokecheck
Python API
from datetime import date
from mxm.refdata.api.ref_data_api import RefDataAPI
api = RefDataAPI()
products = api.get_all_products()
contracts = api.get_contracts_for_product(
"comex_gold_futures"
)
active_contracts = api.get_active_contracts(
as_of_date=date(2026, 5, 1),
)
Operating Modes
Buildable mode
In buildable mode, the reference database is treated as deterministic derived state.
If missing or empty, the package may automatically:
- create the schema,
- generate contracts,
- and materialise the reference universe.
This mode supports:
- development,
- CI,
- local experimentation,
- and early-stage deployments.
Managed mode
Managed mode treats the reference database as governed operational state.
Updates occur explicitly through controlled management and reconciliation workflows.
Development
mxm-refdata is maintained as an mxm-foundry compliant package.
Primary development gate:
make check
Validate repository compliance:
mxm-foundry check .
Setup:
poetry install
Documentation
docs/design.md
Roadmap
v0
- Futures product specifications
- Deterministic futures contract generation
- Trading calendar integration
- Period and period-cycle models
- Materialised SQLite reference store
- Typed query API
- Operational CLI and smoke checks
mxm-foundrycompliance
v1
- Broader futures product coverage
- Stronger typed lifecycle-rule models
- Explicit
TradingCalendarIdabstractions - Improved CLI inspection and filtering
- Clearer ontology boundaries and documentation
v2
- ETF and FX product support
- Managed reference governance
- Historical exchange rule evolution
- External reconciliation workflows
- Expanded multi-venue ontology
- Integration boundaries with
mxm-marketdata - Integration boundaries with future
mxm-calendar
License
MIT License. See LICENSE.
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 mxm_refdata-0.3.0.tar.gz.
File metadata
- Download URL: mxm_refdata-0.3.0.tar.gz
- Upload date:
- Size: 38.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0696a120dbad9af12202af4a586223ff31289956b11d8ea7b48292679e6ec355
|
|
| MD5 |
efdb998f5aaea84cd49f6056e2bc232a
|
|
| BLAKE2b-256 |
3e3a73028cf034dce5a55e3de57d1c2f039fc303568bbf82a11b5fde9e5fabbc
|
Provenance
The following attestation bundles were made for mxm_refdata-0.3.0.tar.gz:
Publisher:
release.yml on moneyexmachina/mxm-refdata
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mxm_refdata-0.3.0.tar.gz -
Subject digest:
0696a120dbad9af12202af4a586223ff31289956b11d8ea7b48292679e6ec355 - Sigstore transparency entry: 1509438161
- Sigstore integration time:
-
Permalink:
moneyexmachina/mxm-refdata@a32007723c61ca90a9d01e49efec8d7b9b1e0045 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/moneyexmachina
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a32007723c61ca90a9d01e49efec8d7b9b1e0045 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mxm_refdata-0.3.0-py3-none-any.whl.
File metadata
- Download URL: mxm_refdata-0.3.0-py3-none-any.whl
- Upload date:
- Size: 57.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c7d7abd88e755155152fac0c184d6010cf2226bf729d29b3ce180b97a797693f
|
|
| MD5 |
f56b3eccbcd0c432b345282ec969bcac
|
|
| BLAKE2b-256 |
580f9ecdcce9a9ad8a04e6646799bbd62d3f3bd2417e3793c13a87c9fb129786
|
Provenance
The following attestation bundles were made for mxm_refdata-0.3.0-py3-none-any.whl:
Publisher:
release.yml on moneyexmachina/mxm-refdata
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mxm_refdata-0.3.0-py3-none-any.whl -
Subject digest:
c7d7abd88e755155152fac0c184d6010cf2226bf729d29b3ce180b97a797693f - Sigstore transparency entry: 1509438260
- Sigstore integration time:
-
Permalink:
moneyexmachina/mxm-refdata@a32007723c61ca90a9d01e49efec8d7b9b1e0045 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/moneyexmachina
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a32007723c61ca90a9d01e49efec8d7b9b1e0045 -
Trigger Event:
push
-
Statement type: