Live demo · Monte Carlo options pricing

Price options on Chalk GPUs

This demo shows how to run Monte Carlo simulations on Chalk GPUs to estimate option prices and stress-test a portfolio of 2,000 synthetic positions. Adjust an option or choose a market scenario to try it, then explore the code to see how it works.

Compare the same pricing work on a GPU and CPU

Use one option configuration for the timing comparison, then inspect the portfolio stress result.

Try this experiment · expected results

  1. 1Price the same option twice

    Choose Price on the GPU, then Same on the CPU without changing inputs or path count.

    Expected: Compare estimated prices and compute times; simulation estimates include sampling uncertainty.

  2. 2Inspect portfolio stress

    Choose a stress scenario or adjust spot and volatility, then select Reprice the book.

    Expected: The result aggregates profit and loss across the synthetic portfolio rather than pricing one option.

Price one option

Choose a synthetic underlying and an option type. See the estimated price and its sensitivities, then compare GPU and CPU compute times.

Select Price on the GPU to see the simulated paths and estimated option price.
40 of … simulated paths · terminal prices on the right
Estimated option price
–
Formula reference
–
Black–Scholes applies to European options
Delta
–
Sensitivity to the underlying price
Gamma
–
How quickly delta changes
Vega
–
Price change per volatility point
Compute
–
Reprice 2,000 positions under a market move

Test a market move

Choose a scenario or adjust the price and volatility changes. One ChalkSQL query reprices all 2,000 synthetic positions and calculates profit or loss by sector.

Book P&L
–
Net delta after
–
P&L by sector

Reprice the book to compare each sector’s profit or loss under the selected market move.

Biggest moversOptionQtyP&L

All instruments, prices, and positions are synthetic. This is a simulation demo, not market data or investment advice. Repeated requests may use a 10-minute cache, and shared rate limits apply to GPU, CPU, and stress runs. Asian averages and barriers are checked at 64 time steps per path.

Demo benchmarks

Recorded on Chalk staging with one NVIDIA L4 on October 15, 2026. These measurements describe this workload. The stress tests reuse random numbers from the original pricing run to reduce simulation noise when comparing scenarios.

European prices vs Black–Scholes986 / 991 within 2 standard errorsthe 991 European positions in the book, marked at 50,000 paths; median error 0.05%
One option with Greeks, GPU7.8 ms200,000 paths × 64 steps, price plus four bumped repricings, NVIDIA L4
The same on 4 CPU cores108 mssame replica, same code, same random numbers: 14× slower
Mark the whole book4.0 s2,000 positions at 50,000 paths, one ChalkSQL query
One stress scenario3.6 sreprice every position, P&L by sector, ChalkSQL query time

Built on Chalk

Chalk connects GPU compute to queries over portfolio data. Deploy the pricer, then use SQL or DataFrames to price positions and compare market scenarios.

  • Run pricing on Chalk GPUs

    Deploy the PyTorch pricer on Chalk. Choose its GPU and set how many copies of the service can run.

  • Price and analyze in one query

    Call the GPU pricer from SQL or a DataFrame through a Chalk function. Reprice positions and calculate profit or loss by sector in the same query.

  • Batch positions for the GPU

    Chalk batches calls to the pricing function. The example’s Python code combines those calls into requests that price multiple positions on the GPU.

  • Keep portfolio data on Chalk

    Upload portfolio files to a Chalk Volume and mount them into the app for pricing and stress tests.

Deploy your own

Run it on your own

Clone the example, generate the synthetic positions, and deploy the GPU pricer, Chalk function, and web app. Price the portfolio with the included SQL query, then change its inputs to run a stress scenario.

You will need uv, Chalk credentials, and GPU capacity. The validation script’s GPU comparison also needs a local CUDA GPU. Follow the repository setup steps to register the function in your environment before running the queries.

chalk-ai/options-monte-carlo
git clone https://github.com/chalk-ai/options-monte-carlo
cd options-monte-carlo
export PRICER_TOKEN=$(openssl rand -hex 16)

./validate.py                            # Monte Carlo vs Black-Scholes, GPU vs CPU timing
./make_universe.py --out data/           # 40 synthetic underlyings, 2,000 positions

./deploy_pricer.py --env-id <env>        # PyTorch pricer on a GPU ScalingGroup
./deploy_functions.py --env-id <env> --pricer https://<pricer>
./deploy_app.py --env-id <env> --pricer https://<pricer> --upload data/
./batch.py --env-id <env> --pricer https://<pricer>   # mark the book with one query

Run simulations alongside your data

Talk to an engineer about connecting GPU pricing and simulation workloads to your data with Chalk.