QuantLib pricing workbench for options and swaps in the browser, built from source
186
A browser workbench for pricing options and interest-rate swaps, backed by QuantLib running as a live, stateful service.
The service keeps each session's QuantLib object graph standing between requests: the curves, the volatility, the index and the instrument. Moving a quote therefore reprices off the graph that already exists instead of rebuilding it, so dragging the spot slider updates the price immediately.
This image contains the whole application, built from source: ql-backend (the C++ WebSocket pricing service, on QuantLib 1.43), ql-frontend (the React app) and its user's guide in English and Traditional Chinese.
docker run --rm -p 127.0.0.1:8080:8080 markccchiang/ql-app
Open http://localhost:8080. The Guide button in the status bar opens the user's guide.
Keep the 127.0.0.1: prefix. The pricing service has no authentication, and
publishing the port on all interfaces would let anyone on your network use it.
| Tag | Contents |
|---|---|
latest | the most recent build of ql-backend and ql-frontend main |
0.1.0 | the build published that day; it never moves, so use it to stay on a known version |
Each tag is published for linux/amd64 and linux/arm64, so it runs natively on Intel/AMD machines and on Apple Silicon.
The service accepts a WebSocket only from browser origins it has been told
about. The defaults are http://localhost:8080 and http://127.0.0.1:8080. If
you publish another port or reach the container under another name, set
QL_ALLOWED_ORIGINS (space-separated):
docker run --rm -p 127.0.0.1:9000:8080 \
-e QL_ALLOWED_ORIGINS="http://localhost:9000 http://127.0.0.1:9000" \
markccchiang/ql-app
Without it, the page loads but the status bar reports the service as running, but refusing this page.
Arguments after the image name are passed to ql-backend:
docker run --rm -p 127.0.0.1:8080:8080 markccchiang/ql-app --max-sessions 8
| Option | Meaning |
|---|---|
--max-sessions N | the most live pricing sessions at once |
--max-connections N | the most WebSocket connections at once |
--session-grace SECONDS | how long a session outlives a dropped connection so the page can resume it (default 60, 0 turns it off) |
docker run -d --name ql-app --restart unless-stopped \
-p 127.0.0.1:8080:8080 markccchiang/ql-app
The image has a health check. docker ps shows the container as healthy once
the service is answering, and curl http://localhost:8080/ws/healthz shows its
status. docker stop shuts it down cleanly.
| Port | 8080: nginx serves the app and the guide, and passes /ws/ to the service |
| Pricing service | ql-backend, listening on loopback inside the container only |
| Libraries | QuantLib 1.43 (sessions enabled) and Protobuf 34.0, linked statically |
| Base | debian:trixie-slim, running as the unprivileged user ql under tini |
The Dockerfile, build instructions and building from your own checkouts are in markccchiang/ql-docker. Report problems with the application to ql-frontend or ql-backend.
ql-backend and ql-frontend are MIT-licensed. QuantLib is distributed under its modified BSD licence, and Protobuf under the BSD 3-Clause licence.
Content type
Image
Digest
sha256:c01fc8bb8…
Size
60.2 MB
Last updated
20 days ago
docker pull markccchiang/ql-app