diff --git a/app/main.py b/app/main.py index f0537ed..b2eb3dc 100644 --- a/app/main.py +++ b/app/main.py @@ -10405,7 +10405,7 @@ async def derive_member_sources() -> dict: return {"checked": len(stale), "flipped": flipped} -FX_POLICY_EUR_USD = float(os.environ.get("FX_POLICY_EUR_USD", "1.16") or 1.16) +FX_POLICY_EUR_USD = float(os.environ.get("FX_POLICY_EUR_USD", "1.0975") or 1.0975) FX_ALERT_PCT = float(os.environ.get("FX_ALERT_PCT", "2.0") or 2.0) @@ -10418,7 +10418,7 @@ def _fx_verdict(rate: float, policy: float = FX_POLICY_EUR_USD, async def fx_spot_check(send: bool = True) -> dict: - """Daily spot check of EUR/USD against the pricing FX (1.16). Alerts, never reprices. + """Daily spot check of the ECB EUR/USD rate against the written fallback pin. Source: ECB daily reference rate. An alert is sent to info@ only when the drift first crosses FX_ALERT_PCT; staying over the line does not mail every day. When @@ -10452,12 +10452,17 @@ async def fx_spot_check(send: bool = True) -> dict: direction = "above" if verdict["drift_pct"] > 0 else "below" verdict["notified"] = bool(send_email( ADMIN_INVITER_EMAIL, - f"EUR/USD {verdict['drift_pct']:+.1f}% {direction} the pricing FX", - f"The ECB rate is {verdict['rate']} USD per EUR; our pricing policy is " - f"{verdict['policy']}. Drift: {verdict['drift_pct']:+.1f}%.\n\n" - "No prices were changed automatically. Decide whether to re-convert " - "GreenPT/Regolo EUR list prices at the new rate (scripts/check_eur_fx.py " - "in code/litellm guards the conversion).\n")) + f"EUR/USD {verdict['drift_pct']:+.1f}% {direction} the fallback pin", + f"The ECB rate is {verdict['rate']} USD per EUR; the written fallback " + f"pin is {verdict['policy']}. Drift: {verdict['drift_pct']:+.1f}%.\n\n" + "Live billing is not affected: the gateway re-converts GreenPT/Regolo " + "EUR list prices at the ECB daily rate on every boot (fx_sync.py). " + "Drift means the COMMITTED figures are stale — regenerate the USD " + "fallback in code/litellm/config.yaml (scripts/check_eur_fx.py guards " + "it), refresh the USD columns in ops-docs/provider-pricing/, keep " + "FX_FALLBACK_USD and this portal's FX_POLICY_EUR_USD in step, and " + "confirm /app/data/fx_state.json in the gateway carries a fresh feed " + "date.\n")) conn = get_db() try: