49 lines
2.6 KiB
Markdown
49 lines
2.6 KiB
Markdown
# EquiCompiler: Algebraic Portfolio DSL to Verifiable Low-Latency Compiler (MVP)
|
|
|
|
Overview
|
|
- This repository contains a minimal, production-ready MVP for a compiler stack that translates a domain-specific language for market strategies into a portable, verifiable execution graph. The MVP focuses on a small, well-formed core to enable safe extension by additional agents in the swarm.
|
|
|
|
What you get in this MVP
|
|
- A small DSL parser that reads a concise DSL and converts it into a canonical in-memory IR (EquiIR) represented as Python dicts.
|
|
- A minimal Python package equicompiler_algebraic_portfolio_dsl_to_ with a core module and a CLI entry point.
|
|
- A tiny test suite to validate DSL parsing and IR generation.
|
|
- A test runner (test.sh) that executes tests and builds the package to verify packaging metadata.
|
|
|
|
Usage
|
|
- DSL to IR (programmatic):
|
|
from equicompiler_algebraic_portfolio_dsl_to_.core import parse_dsl_to_ir
|
|
dsl = "assets: AAPL, MSFT, GOOG\nobjectives: maximize_return\nconstraints: max_drawdown=0.2, var=0.95"
|
|
ir = parse_dsl_to_ir(dsl)
|
|
print(ir)
|
|
|
|
- CLI (Python module):
|
|
python -m equicompiler_algebraic_portfolio_dsl_to_.cli path/to/dsl_file.txt
|
|
|
|
Project structure
|
|
- AGENTS.md: architecture and testing guidelines for future agents
|
|
- README.md: this file
|
|
- pyproject.toml: packaging metadata
|
|
- equicompiler_algebraic_portfolio_dsl_to_/ (package)
|
|
- __init__.py
|
|
- core.py: DSL -> IR parser (minimal)
|
|
- cli.py: CLI entry point
|
|
- tests/test_core.py: small unit test for DSL parsing
|
|
- test.sh: test runner to validate test suite and packaging
|
|
|
|
Development notes
|
|
- The MVP intentionally keeps dependencies minimal to ensure fast iterations and deterministic tests.
|
|
- When adding features, try to keep changes small and focused on a single goal.
|
|
- Ensure tests cover the new functionality and avoid sensitive data in tests.
|
|
|
|
Next steps
|
|
- Extend the DSL with richer constraints (VaR, VaR-CVaR, liquidity, latency) and ExecutionPolicy primitives.
|
|
- Integrate the GoC registry and build a canonical EquiIR representation with per-message metadata for replay/verification.
|
|
- Add a lightweight delta-sync coordinator and starter adapters for data feeds and brokers.
|
|
- Expand the test suite to exercise the new backtester and Graph-of-Contracts scaffolds.
|
|
- Improve packaging and docs to support publishing to a Python package index.
|
|
- Implement a more expressive DSL and a richer IR (EquiIR) representation.
|
|
- Add more tests for edge cases and simple integration tests for the CLI.
|
|
- Expand packaging metadata and README with a longer developer and user guide.
|
|
|
|
This README intentionally stays light; the AGENTS.md contains the deeper architectural notes for the SWARM collaborators.
|