A full stack application that utilizes the Heston Model and Longstaff Schwartz approach to price American and European Options
Access the site at https://www.optionspricerapp.com/
- Python 3.11
- Node.js (for frontend)
- API keys from:
- Alpha Vantage (for dividend data)
- Twelve Data (for stock price data)
Create a .env file in the backend/ directory with the following variables:
# Required API Keys
ALPHAVANTAGE_API_KEY=your_alphavantage_api_key_here
TWELVE_API_KEY=your_twelve_data_api_key_here
# Optional Supabase Configuration (has defaults)
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_KEY=your_supabase_anon_key_hereQuick Setup: Run the setup script to create your .env file:
cd backend
python setup_env.py- Clone the repository
- Install backend dependencies:
cd backend pip install -r ../requirements.txt - Install frontend dependencies:
cd web npm install
-
Set up environment variables (first time only):
cd backend python setup_env.py -
Start the backend server:
cd backend python server.pyThe server will start on http://localhost:5000
-
Start the frontend (in a new terminal):
cd web npm startThe React app will start on http://localhost:3000
-
Test the pricing logic (optional):
cd backend python test_pricing.py
Note: The frontend will automatically connect to the backend API at http://localhost:5000
In the top left of the application there is a form where users first enter a stock ticker they would like to price an option on. Other parameters (Strike price, time-to-expiry, number of simulations) are selected in the same form. When the parameters are selected, the "Calculate" button is used to begin calculating Options Price. Upon calculation, the application visualizes a sample of 100 of the user's simulated paths, the standard error for American Prices, and a distribution of the returns on the final day.

