Intelligence, Advanced Charting & Trading Platform
phase-1/data-proof-artifact
diagnostics/chartnova-blank-screen-2026-10-15
diagnostics/chartnova-stage2-v27-preview-2026-10-15
docs/chartnova-stage1-reconcile-manifest-2026-10-15
feature/chartnova-ios-widget
feature/chartnova-light-catalog-lazy-series-2026-10-15
feature/chartnova-market-terminal
feature/chartnova-multimarket-chart-ws-foundation
feature/chartnova-neon-direct-history
feature/chartnova-neon-history
feature/paper-trading-risk-controls-2026-10-14
fix/alpha-vantage-live-payload
fix/chartnova-progressive-loading-2026-10-15
fix/live-proof-runner-cwd-2026-10-14
foundation/phase-0
foundation/postgres-core
main
ops/chartnova-emergency-rollback-2026-10-15
phase-1/candle-builder
phase-1/data-proof-artifact
phase-1/data-proof-metrics
phase-1/data-proof-report
phase-1/external-gates-state
phase-1/gold-api-fallback
phase-1/ingestion-pipeline
phase-1/live-proof-runner
phase-1/market-calendar
phase-1/market-domain
phase-1/neon-live-proof
phase-1/persistence-contract
phase-1/postgres-ci
phase-1/provider-adapters
phase-1/provider-recovery
phase-1/quality-propagation
phase-1/spike-detection
phase-1/xau-provider-adapter
risk/chartnova-alert-runtime-atomic-2026-10-22
risk/chartnova-atomic-outbox-2026-10-22
risk/chartnova-seven-track-safety-2026-10-21
safety/p0-triage-2026-10-13
| 1 | # Canonical Market Data Contracts |
| 2 | |
| 3 | ## Canonical instruments |
| 4 | |
| 5 | | Symbol | Class | Market | Canonical unit | |
| 6 | |---|---|---|---| |
| 7 | | `USD_IRT_FREE` | FX | Iran free market | IRT per USD | |
| 8 | | `GOLD18_IRT` | Commodity | Iran | IRT per gram 18K | |
| 9 | | `XAU_USD` | Commodity | Global spot | USD per troy ounce | |
| 10 | | `GOLD18_THEORETICAL_IRT` | Derived | VELYQOR | IRT per gram 18K | |
| 11 | | `GOLD18_PREMIUM_IRT` | Derived | VELYQOR | IRT per gram 18K | |
| 12 | | `GOLD18_PREMIUM_PCT` | Derived | VELYQOR | percent | |
| 13 | |
| 14 | Provider symbols are mappings and must never replace canonical symbols. |
| 15 | |
| 16 | ## Units |
| 17 | - Iran-facing canonical currency unit for MVP: toman (`IRT`). |
| 18 | - Provider rial values must be normalized in the provider adapter; the raw provider value remains auditable. |
| 19 | - 1 troy ounce = 31.1034768 grams. |
| 20 | - 18K purity factor = 0.75. |
| 21 | |
| 22 | ## Theoretical 18K gold |
| 23 | |
| 24 | `gold18_theoretical_irt = (xau_usd / 31.1034768) * 0.75 * usd_irt_free` |
| 25 | |
| 26 | Premium absolute: |
| 27 | |
| 28 | `premium_irt = gold18_market_irt - gold18_theoretical_irt` |
| 29 | |
| 30 | Premium percentage: |
| 31 | |
| 32 | `premium_pct = (gold18_market_irt / gold18_theoretical_irt - 1) * 100` |
| 33 | |
| 34 | ## Time contract |
| 35 | - Canonical backend/database timestamps: UTC. |
| 36 | - Iran presentation timezone: `Asia/Tehran`. |
| 37 | - Provider timestamp and receive timestamp are separate fields. |
| 38 | - Raw provider timestamp is retained where available. |
| 39 | - Derived calculations align source observations to a target timestamp and record the selected source timestamps. |
| 40 | |
| 41 | ## Derived-value provenance |
| 42 | Every derived value must retain at least: |
| 43 | - target timestamp |
| 44 | - XAU/USD value and timestamp |
| 45 | - USD/IRT value and timestamp |
| 46 | - formula/calculation version |
| 47 | - quality status/score |
| 48 | - staleness/quality flags |
| 49 | |
| 50 | ## Quality states |
| 51 | Minimum semantic states: |
| 52 | - `GOOD` |
| 53 | - `DEGRADED` |
| 54 | - `STALE` |
| 55 | - `INVALID` |
| 56 | |
| 57 | A `STALE` or `INVALID` observation must not be rendered as healthy live data. |
| 58 | |
| 59 | ## Candle invariants |
| 60 | For every candle: |
| 61 | - `low <= open <= high` |
| 62 | - `low <= close <= high` |
| 63 | - `open_time < close_time` |
| 64 | - unique `(instrument, timeframe, open_time)` |
| 65 | - candle/session boundaries use the relevant market calendar rather than blindly assuming UTC midnight. |
| 66 | |
| 67 | ## Initial timeframes |
| 68 | Candidate timeframes are `1m`, `5m`, `15m`, `30m`, `1h`, `4h`, `1d`. A timeframe is exposed in UI only when source frequency and quality genuinely support it. |