INNER CODE UNIT · Python
_set_cached_market
YichengYang-Ethan/oracle3 · oracle3/blinks/server.py:44
def _set_cached_market(ticker: str, data: dict) -> None:
"""Store market metadata in cache."""
_market_cache[ticker] = (time.monotonic(), data)
def _build_app():
"""Build and return the FastAPI application (lazy import)."""
try:
from fastapi import FastAPI, HTTPException, Query
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import JSONResponse
from pydantic import BaseModel, Field
except ImportError as exc:
raise RuntimeError(
'FastAPI not installed. Install with: poetry install -E blinks'
) from exc
class ExecuteTradeBody(BaseModel):