# Options Modelling Platform

A single-page React dashboard for options pricing models (Black-Scholes, Monte Carlo, Binomial), with a Bloomberg-like aesthetic. Includes a serverless proxy to fetch Yahoo Finance quotes for reliable demo data.

## Features
- Deterministic Monte Carlo (seeded RNG) and Binomial pricing visualizations
- Market feed panel with clickable tickers to populate parameters
- Region & model selector UI
- 3D bevelled panels and metallic gradient theme

## Local development

```bash
# Install deps
npm install

# Run dev server
npm run dev
```

Open the URL shown by Vite. Charts require container heights which are already set in the UI.

## Serverless Yahoo proxy (Vercel)
This project includes a tiny Vercel serverless function at `api/yahoo.js` to proxy Yahoo Finance quotes.

- Endpoint: `/api/yahoo?symbols=SPY,QQQ,IWM,NVDA,TSLA,AAPL,AMZN,MSFT,AMD,COIN`
- Response: `{ ok: true, results: [{ id, ticker, price, change }, ...] }`
- CORS: `Access-Control-Allow-Origin: *` is enabled for demo purposes.

### Deploy on Vercel
1. Push this repo to GitHub.
2. Import the repo in Vercel and deploy (Framework preset: Vite).
3. The serverless function will be available at `https://<your-project>.vercel.app/api/yahoo`.
4. The app is already configured to call `/api/yahoo` by default; if the function is not available, it falls back to a public CORS proxy.

### Testing locally
Vercel CLI can run serverless functions locally:

```bash
npm i -g vercel
vercel dev
```

Then open the dev URL and confirm the market feed populates. Alternatively, hit the function directly:

```bash
curl "http://localhost:3000/api/yahoo?symbols=SPY,QQQ"
```

## Configuration
- Market quotes: handled in `src/lib/market.js` with a timeout and a built-in fallback dataset.
- Volatility mapping: `VOLATILITY_MAP` inside `src/lib/market.js` is used when clicking tickers to seed `sigma`.

## Notes
- For production reliability, prefer the serverless proxy over public CORS proxies.
- Consider adding rate-limiting and origin restrictions if you plan to publish widely.
