Quantra is a QuantLib-based pricing service built for parallel execution. It exposes pricing functionality over gRPC with FlatBuffers, and it also includes an optional HTTP/JSON gateway for easier integration and generated OpenAPI documentation.
QuantLib is powerful, but it is not naturally suited to high-concurrency service workloads because important state such as Settings::instance().evaluationDate() is global to the process. Quantra works around that by running multiple isolated pricing workers and placing Envoy in front of them as a load balancer.
- A C++ pricing server built on QuantLib
- A gRPC API using FlatBuffers messages
- An optional JSON/HTTP gateway in
jsonserver/ - A C++ client in
client/ - A Python client package in
quantra-python/ - Build, schema generation, and process-management tooling in
scripts/andtools/quantra-manager/ - Integration and parity tests in
tests/
Representative supported request types include:
- Fixed-rate bonds
- Floating-rate bonds
- Vanilla swaps
- OIS swaps
- Basis swaps
- Zero-coupon inflation swaps
- Year-on-year inflation swaps
- FRAs
- Caps and floors
- Swaptions
- CDS
- Equity options
See examples/data/ for sample payloads.
The main runtime model is a multi-process gRPC service fronted by Envoy:
client -> Envoy (:50051) -> sync_server workers (:50055+)
Typical local or container workflow:
- Build schemas and binaries
- Start the gRPC worker cluster with
quantra - Optionally run
json_serverto expose HTTP/JSON endpoints
The default production image starts the gRPC cluster and exposes port 50051.
docker build -t quantra .
docker run --rm -p 50051:50051 quantraSee docs/build.md for environment setup details. Once dependencies are available:
./scripts/build.sh Release
./scripts/quantra start --workers 4 --foregroundThe JSON server is built as a separate binary and connects to the gRPC endpoint:
./build/jsonserver/json_server localhost:50051 8080You can then call the HTTP API with sample requests from examples/data/:
curl -X POST http://localhost:8080/price-fixed-rate-bond \
-H "Content-Type: application/json" \
-d @examples/data/fixed_rate_bond_request.jsonThe generated OpenAPI files live in jsonserver/openapi/.
./scripts/build.sh regenerates schemas, recreates build/, and compiles the project.
./scripts/build.sh
./scripts/build.sh ReleaseIf you are editing FlatBuffers schemas and want to regenerate artifacts without a full build:
./scripts/generate_schemas.shbash tests/run_all_tests.shThe test suite exercises:
- C++ pricing parity against QuantLib
- C++ gRPC integration
- JSON HTTP API scenarios
- Python client scenarios
server/: gRPC pricing serverjsonserver/: HTTP/JSON gateway and generated OpenAPI docsrequest/: request entrypoints and endpoint orchestrationparser/: parsing, domain conversion, pricing helpers, and buildersclient/: C++ client libraryquantra-python/: Python client packageflatbuffers/: schema sources plus generated C++, Python, and JSON artifactsgrpc/: gRPC service definitions and generated service bindingsexamples/data/: example JSON requeststests/: parity, integration, and client testsscripts/: build, code generation, and runtime helperstools/quantra-manager/: packaged process-manager implementationdocs/: project documentation and reference notes
docs/README.md: documentation indexdocs/build.md: environment setup and build detailsdocs/scripts.md: build and schema toolingdocs/testing.md: test suite detailsdocs/process-manager.md: process-manager behavior and runtime modeldocs/client.md: C++ client notesdocs/parser.md: parser/service/builder conventionsdocs/versioning.md: versioning policyCONTRIBUTING.md: contribution workflow
The repository currently documents and builds around:
- CMake
3.16+ - GCC
12+or Clang14+ - gRPC
v1.60.0 - FlatBuffers
v24.12.23 - QuantLib
1.41in Docker builds - Envoy for worker load balancing
MIT / Apache 2.0