How luckypant10307-coder/mcx works
MCX Gold Spread Monitor ingests settlement and margin data, normalizes contracts and estimates relative-value signals, applies trading and risk gates, and simulates outcomes without placing orders. The nightly pipeline publishes a JSON snapshot; the API serves it to the dashboard and supports signed-in assistant and notification features. The README also documents timestamped attestations and circular monitoring. Edges are limited to relationships visible in excerpts, the source index, or README; some unsampled UI and integration links are therefore left dashed or omitted.
Main entry points: pipeline.py Analysis pipeline · main.py FastAPI routes · service.py Snapshot API service · sources Market sources
Components 25
Data intake
- Market sources
mcxrv/sources - Published margins
mcxrv/published_margins.py - Validation and calendar
mcxrv/stage1_intake/validation.py - Contract specifications
mcxrv/stage1_intake/specs.py - Anomaly review
mcxrv/stage1_intake/anomaly.py
Signal engine
- Price normalization
mcxrv/stage2_normalize_signal/normalize.py - Carry and residuals
mcxrv/stage2_normalize_signal/half_life.py - Pair matching
mcxrv/stage2_normalize_signal/pair_match.py - Pair signals
mcxrv/stage2_normalize_signal/z_score.py - Analysis pipeline
mcxrv/pipeline.py
Gates and simulation
- Liquidity and costs
mcxrv/stage3_gates_decision/liquidity_cost.py - Margin and capital
mcxrv/stage3_gates_decision/margin_capital.py - Risk board
mcxrv/stage3_gates_decision/risk.py - Walk-forward replay
mcxrv/stage4_simulate_deliver/replay_driver.py
API and dashboard
- Published snapshot
mcxrv/snapshot.py - Snapshot API service
api/service.py - FastAPI routes
api/main.py - Dashboard pages
frontend/src/main.tsx
User services
- Read-only assistant
mcxrv/assistant.py - Circular monitoring
mcxrv/circulars.py - Notifications
mcxrv/notify.py - Timestamped attestations
mcxrv/attest.py
Other components
- Nightly job
- MCX settlement data
- Signed-in user
Connections 25
- Nightly job → Analysis pipeline: runs nightly
- MCX settlement data → Market sources: provides prices
- Market sources → Analysis pipeline: supplies input
mcxrv/pipeline.py - Published margins → Analysis pipeline: supplies margin rates
mcxrv/pipeline.py - Analysis pipeline → Validation and calendar: validates data
mcxrv/pipeline.py - Validation and calendar → Contract specifications: uses contract rules
mcxrv/stage1_intake/validation.py - Analysis pipeline → Anomaly review: includes review
mcxrv/pipeline.py - Analysis pipeline → Price normalization: normalizes prices
mcxrv/pipeline.py - Analysis pipeline → Carry and residuals: fits carry
mcxrv/pipeline.py - Analysis pipeline → Pair matching: matches contracts
mcxrv/pipeline.py - Analysis pipeline → Pair signals: computes signals
mcxrv/pipeline.py - Analysis pipeline → Liquidity and costs: prices trading costs
mcxrv/pipeline.py - Analysis pipeline → Margin and capital: loads margin model
mcxrv/pipeline.py - Analysis pipeline → Risk board: builds risk board
mcxrv/pipeline.py - Analysis pipeline → Walk-forward replay: runs backtest
mcxrv/pipeline.py - Analysis pipeline → Published snapshot: builds snapshot
- Published snapshot → Snapshot API service: loads snapshot
api/service.py - FastAPI routes → Snapshot API service: routes requests
api/main.py - Dashboard pages → FastAPI routes: requests dashboard data
- FastAPI routes → Read-only assistant: answers questions
api/main.py - Snapshot API service → Circular monitoring: checks on demand
api/service.py - Analysis pipeline → Notifications: drives alerting
- Analysis pipeline → Timestamped attestations: records decisions
- Signed-in user → Dashboard pages: views results
- Signed-in user → Read-only assistant: asks questions