From e7b0522f3866f6270a26b0bb115d3f954f2391c9 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 20 Jun 2026 19:29:33 +0000 Subject: [PATCH] Add public pricing proxy endpoint (forwards to Vela Platform P&L) --- server.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/server.py b/server.py index eeeb90d..561c818 100644 --- a/server.py +++ b/server.py @@ -165,6 +165,21 @@ class AnalyzeBody(BaseModel): submission_ids: list[int] = [] all: bool = False + +# ---- Public Pricing Proxy (fetches from P&L Platform on CT 125) ---- + +@app.get("/api/public/pricing") +async def proxy_public_pricing(): + """Proxy: fetch live pricing from Vela Platform P&L manager.""" + import urllib.request, json + try: + req = urllib.request.Request("http://192.168.1.125/api/public/pricing") + with urllib.request.urlopen(req, timeout=5) as resp: + return json.loads(resp.read().decode()) + except Exception as e: + raise HTTPException(502, f"P&L backend unavailable: {e}") + + # ---- Auth ---- @app.post("/admin/login")