# ECB FX Daily Feed Structured JSON API & Volatility Risk Desk

- **Canonical HTML**: https://quantdesk.fastmesh.dev/seo_geo/ecb-fx-daily-feed-structured-json-api.html
- **Target Query**: `ECB FX daily feed structured JSON API` (`how_to`)
- **Source Family**: `ecb_fx` | **MCP Tool**: `quantdesk_full_brief` | **Pricing**: $0.10 full brief ($0.05 harvest-only; $0 on weekend unchanged diff)
- **Seed**: `42` | **Trials**: `10000` | **Receipt SHA-256**: `410adbe9e36ebf3e5ae7384e9ec601d434a1aaa777a98f2a52c6a284ec04bb88`

## Direct Answer
Convert European Central Bank eurofxref-daily.xml (29 currencies) and eurofxref-hist-90d.xml into canonical Decimal-quantized JSON with cross-rate triangulation, 20-day realized volatility, z-score regime signals, and 10,000-trial FX tail-risk modeling via REST and Remote MCP.

## Decimal FX Cross-Rate Triangulation, Realized Volatility & Z-Score
- Decimal Cross Rates: USD/JPY = Decimal(EUR/JPY) / Decimal(EUR/USD); GBP/USD = Decimal(EUR/USD) / Decimal(EUR/GBP).
- 20-Day Annualized Realized Volatility: sigma_20d = std(r_t) * sqrt(252) where r_t = (S_t - S_{t-1}) / S_{t-1}.
- Regime Dislocation Score: z = (S_t - mu_20d) / sigma_20d; factor_score = clamp(z / Decimal('3.0'), -1.0, 1.0).

## Deterministic 10,000-Trial Risk Metrics (Seed 42)
- P5 / P50 / P95 Return: -4.46% / +0.04% / +4.55%
- Mean / Std Return: +0.08% / 2.76%
- VaR 95 / CVaR 95: 4.46% / 5.53%
- VaR 99 / CVaR 99: 6.18% / 7.06%
- Max Drawdown (95th) / Ruin Probability: 5.29% / 0.00%
- Half-Kelly Cap: 25.00%
- Top Tornado Driver: `expected_return` (swing 5.73%, variance share 73.9%)

## Key Engineering Capabilities
- Explicitly binds XML namespace http://www.ecb.int/vocabulary/2002-08-01/eurofxref so <Cube> nodes never return empty lists.
- Respects ECB CDN cache-control (max-age=300) and skips billing on TARGET weekends/holidays when @time has not advanced.
- Combines daily EUR reference rates directly into Stage 4 VaR 95/99 and CVaR 95/99 FX hedging simulations.

## Remote `/mcp` Invocation Example
```bash
curl -fsSL -X POST "https://quantdesk.fastmesh.dev/mcp" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "quantdesk_full_brief", "arguments": {"source_type": "ecb_fx", "source_url": "https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml", "seed": 42, "trials": 10000, "horizon_days": 21, "initial_capital": 500000}}}'
```

## Frequently Asked Questions
### Why does standard Python ElementTree findall('.//Cube') fail on ECB FX XML?
ECB eurofxref XML binds all <Cube> tags to the default namespace http://www.ecb.int/vocabulary/2002-08-01/eurofxref. Unnamespaced queries silently return zero currencies; Agent-WallStreet-Desk binds both gesmes and ecb namespaces explicitly.

### What happens when my watch job polls ECB FX XML on Saturday or a European TARGET holiday?
The ECB does not publish new rates on weekends or TARGET closing days. Stage 3 watch-diff detects the identical @time and SHA-256 rate map and returns changed=false with billed_micros=0.

### Are cross rates like USD/JPY and GBP/USD computed with binary floats?
No. All cross-rate divisions use Python's decimal.Decimal to eliminate binary IEEE-754 rounding drift in FX accounting.

## Compliance & Zero-Resale Policy
Agent-WallStreet-Desk is a deterministic quantitative public-disclosure extraction and Monte Carlo risk modeling engineering tool only. It is NOT investment advice under the U.S. Investment Advisers Act of 1940, NOT a broker-dealer, and provides ZERO asset management, trade execution, or custody. 100% legal public regulatory disclosures and public market data only (zero MNPI, zero paywall bypass). Strictly $0 billed on empty, unchanged, fake-200, SSRF-blocked, or HTTP 422 responses. Zero client trading strategy, portfolio holdings, or watchlist retention or resale (zero_resale_policy: true). Support: support@fastmesh.dev.
