Financial markets ORM, engines, and application management extensions for Main Sequence.
Project description
MainSequence Markets
ms-markets is the financial markets extension layer for the Main Sequence
platform. It provides reusable market-domain ORM models, market DataNodes,
pricing engines, portfolio construction utilities, repository operations, and
application-facing helpers for building financial systems on top of Main
Sequence.
The Python distribution is named ms-markets. The import package is
intentionally short:
import msm
Project Status
- Status: initial scaffold and SDK extraction
- Current package version:
0.0.1 - Documentation: Documentation Site
- Open issues: GitHub Issues
- Release history: CHANGELOG.md
- License: Apache License 2.0
The initial core package was migrated from
mainsequence-sdk/mainsequence/markets into this repository under src/msm.
Architecture and implementation decisions are tracked in
Architecture Decision Records.
What This Repository Contains
Main package areas:
msm.accounts: account identity, holdings, virtual funds, and account target assignmentsmsm.api: user-facing Pydantic row objects and typed class methods for markets MetaTable recordsmsm.client: client-facing Main Sequence market models and API wrappersmsm.data_nodes: market DataNode contracts, including asset snapshots and asset pricing detailsmsm.execution: order managers, target quantities, orders, events, trades, and execution errorsmsm.models: SQLAlchemy market-domain*Tabledeclarations and MetaTable registration ordermsm.portfolios: portfolio configuration, signal weights, rebalance strategies, and Virtual Fund Builder workflowsmsm.pricing: QuantLib-backed instruments, curves, fixings, and pricing helpersmsm.repositories: compiled persistence operations over market-domain modelsmsm.services: application-level orchestration over repositories, including asset lookup and OpenFIGI service helpers
Repository areas:
docs/: MkDocs documentation, tutorials, knowledge guides, ADRs, and API reference scaffoldexamples/: migrated market examples from the SDK.agents/skills/: local agent skills for market-domain workflowstests/: automated testssrc/cli/: placeholder for a future command-line interface
Documentation Map
The documentation is organized into four reading modes:
- Tutorial: guided learning material
- Knowledge: concept-oriented guides for each
msmpackage area - Architecture: ADRs that record implementation decisions
- Reference: generated API reference scaffold
Recommended entry points:
Quick Start
Install the package from this repository in editable mode:
python -m pip install -e ".[dev]"
Or with uv:
uv sync --extra dev
Verify the import:
python -c "import msm; import msm.pricing; print(msm.__version__)"
Common Development Commands
Run tests:
pytest
Run focused linting for pricing:
ruff check src/msm/pricing
Serve the docs locally:
mkdocs serve
Build the docs:
mkdocs build --strict
Build the package:
uv build
Publish a tagged release to PyPI:
git tag v0.0.2
git push origin v0.0.2
Pushing a v* tag triggers
.github/workflows/publish-to-pypi.yml, which builds the distribution and
publishes it to PyPI through GitHub Actions using trusted publishing for the
repository pypi environment.
Core Dependencies
Runtime dependencies are declared in pyproject.toml. The core stack starts with:
mainsequencefor platform integrationSQLAlchemyfor market-domain ORM modelsQuantLibfor instrument and pricing primitivespydanticfor typed configuration and serialized instrument termspandasandnumpyfor tabular market data and portfolio workflows
Optional extras provide documentation, development, portfolio, pricing, and Streamlit UI tooling.
Package Metadata
- Distribution name:
ms-markets - Import package:
msm - Python:
>=3.11 - License: Apache-2.0
- Repository: https://github.com/mainsequence-projects/MainSequenceMarkets
Project metadata is defined in pyproject.toml.
License
This project is open source under the Apache License 2.0.
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 ms_markets-0.0.3.tar.gz.
File metadata
- Download URL: ms_markets-0.0.3.tar.gz
- Upload date:
- Size: 236.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
121ce81fff990833d54c7b81cfd1c715e213630426ded846289177a64d23166a
|
|
| MD5 |
1388d73ff724f5aff36ca13980854b26
|
|
| BLAKE2b-256 |
a7e0680816a9e6da2914451ef2def6dd749b6b32b390bb868fcc6c9f35c45dd6
|
Provenance
The following attestation bundles were made for ms_markets-0.0.3.tar.gz:
Publisher:
publish-to-pypi.yml on mainsequence-projects/MainSequenceMarkets
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ms_markets-0.0.3.tar.gz -
Subject digest:
121ce81fff990833d54c7b81cfd1c715e213630426ded846289177a64d23166a - Sigstore transparency entry: 1640257181
- Sigstore integration time:
-
Permalink:
mainsequence-projects/MainSequenceMarkets@ac60110dc7874ff169c0148b5f3309632361be60 -
Branch / Tag:
refs/tags/v0.0.3 - Owner: https://github.com/mainsequence-projects
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@ac60110dc7874ff169c0148b5f3309632361be60 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ms_markets-0.0.3-py3-none-any.whl.
File metadata
- Download URL: ms_markets-0.0.3-py3-none-any.whl
- Upload date:
- Size: 243.1 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 |
2a657dc9bc667c26a04677104c8a978b66a7db76b7b177b3fcc9274136d18bb0
|
|
| MD5 |
1518ec2f767683eba8837309e6e33b99
|
|
| BLAKE2b-256 |
1fa16482e1ecab6a28caf028d7aa3b13c1052c5d4a1fdcbf8d037fd73326627f
|
Provenance
The following attestation bundles were made for ms_markets-0.0.3-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on mainsequence-projects/MainSequenceMarkets
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ms_markets-0.0.3-py3-none-any.whl -
Subject digest:
2a657dc9bc667c26a04677104c8a978b66a7db76b7b177b3fcc9274136d18bb0 - Sigstore transparency entry: 1640257391
- Sigstore integration time:
-
Permalink:
mainsequence-projects/MainSequenceMarkets@ac60110dc7874ff169c0148b5f3309632361be60 -
Branch / Tag:
refs/tags/v0.0.3 - Owner: https://github.com/mainsequence-projects
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@ac60110dc7874ff169c0148b5f3309632361be60 -
Trigger Event:
push
-
Statement type: