Oracle3
Open-source trading engine and MCP server for prediction markets. Fee-aware no-arbitrage trading across related contracts, live on Kalshi, Polymarket and Solana or on paper.
Black-Scholes-Merton, American binomial tree, Longstaff-Schwartz, Greeks, implied volatility and volatility surfaces. Enter any premium and see how everything reacts.
Translation pending
FinancePythonGitHub @FerrsirOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
No updates detected yet. GitHub releases will appear here.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
Options premium pricer (BSM, American binomial tree, LSMC, Greeks, IV surface) - Traders@SMU HW1
Translation pending
Taken from the repository README
Loading the full README. The saved excerpt is shown below.
Traders@SMU · HW 1. Black-Scholes-Merton, American binomial tree, Longstaff-Schwartz Monte Carlo, Greeks, implied volatility and volatility surfaces, as a Python package, a CLI and a website.Read the full README ↗
Traders@SMU · HW 1. Black-Scholes-Merton, American binomial tree, Longstaff-Schwartz Monte Carlo, Greeks, implied volatility and volatility surfaces, as a Python package, a CLI and a website.
Live site: https://ferrsir.github.io/options-pricer/
| HW requirement | Where |
|---|---|
| BSM pricer (+ dividend yield) | src/pricer/bsm.py |
| American options pricer (CRR tree, exercise-vs-continue at each node) | src/pricer/binomial.py |
| LSMC (regression on basis functions, compare to the tree) | src/pricer/lsmc.py |
| Greeks + visualizations (stretch) | bsm_greeks, viz.py, Greeks tab on the site |
| Slide sanity checks | checks.py, 31 tests in tests/ |
| Implied vol from a market premium | implied_vol, Your premium box on the site |
| Vol-surface picture from Yahoo Finance | python -m pricer surface NDX |
| Ticker → Yahoo data | data.py + site |
| How every number is derived | METHODOLOGY.md |
| Plain-English explanation of every term, number and graph | GUIDE.md (also the Guide tab on the site) |
| Type your own premium and see what happens | Your premium box, banner and What-if tab on the site |
git clone https://github.com/Ferrsir/options-pricer && cd options-pricer
python -m venv .venv && .venv\Scripts\activate # macOS/Linux: source .venv/bin/activate
pip install -e ".[dev]"
python -m pytest -q # 31 tests
# manual inputs: 1y ATM put, 5% rate, 20% vol; American tree + LSMC + charts
python -m pricer price --spot 100 --strike 100 --years 1 --rate 0.05 --vol 0.2 --type put --lsmc --out output/put
# from a ticker (spot, rate, dividend yield, historical vol pulled from Yahoo Finance)
python -m pricer price --ticker AAPL --strike 340 --days 30 --type call
# you saw a premium in the market: solve implied vol and price with it
python -m pricer price --ticker AAPL --strike 340 --days 30 --type call --premium 9.25
python -m pricer iv --premium 9.25 --spot 335 --strike 340 --days 30 --rate 0.04
Sample output (S=K=100, T=1, r=5%, σ=20% put):
BSM (European, closed form) 5.5735
European tree (1000 steps) 5.5715 (error vs BSM -0.00200)
American tree (1000 steps) 6.0896 (early-exercise premium +0.5181)
American LSMC (100000 paths) 6.0608 (± 0.0440 95% CI; biased slightly low)
python -m pricer surface NDX --out output/ndx_surface.png # any ticker with listed options
python -m pricer surface --demo # synthetic data, works offline
python -m pricer checks
python -m pricer serve # http://localhost:8000
docs/ is a static site (plain JS + Plotly, no build step) served by GitHub Pages. The pricing engine is re-implemented in JavaScript and agrees with Python to ~1e-12.
Ticker data: any optionable US ticker. Neither Yahoo Finance nor Cboe can be called from a web page (no CORS), so the site talks to a small API and degrades gracefully:
python -m pricer serve on your machine: Yahoo Finance first, Cboe's public delayed chains as the automatic fallback; the vol surface is built in Python.serverless/ (standard-library Python, Cboe data): quotes, chains and a compact multi-expiry payload. The browser builds the vol surface itself (docs/js/surface.js, a port of the Python pipeline, checked against it to ~1e-13). It is deployed on Vercel (https://options-pricer-api-five.vercel.app) and wired in through DEFAULT_API in docs/js/data.js.docs/data/snapshots.json: NDX, SPX, SPY, QQQ, AAPL, MSFT, NVDA, TSLA, AMZN, GOOGL, META, refreshed with python scripts/snapshot.py) when no API is reachable.src/pricer/ bsm.py binomial.py lsmc.py surface.py data.py viz.py checks.py cli.py server.py
tests/ 31 tests: reference values, parity, Greeks vs finite differences, tree convergence, LSMC, surface recovery, any-ticker data layer
docs/ the website (GitHub Pages) · scripts/snapshot.py, build_guide.py · METHODOLOGY.md, GUIDE.md
For AI agents (Claude Code, Codex) and contributors: read AGENTS.md first. It has the rules, commands and a handoff log the agents use to talk to each other.
Educational project, not investment advice. Market data from Yahoo Finance via yfinance, which may be delayed or inaccurate.