Python components for QA: Design your contract with the algebra. Monitor and price it with the API
Project description
๐บ Project Status
โญ Star the project on GitHub helps it to progress.
๐ฐ Latest news
- 2024-01-30
- ๐(Release) qa-v0.2.3 is out ๐
๐ท Current work
- 2024-01-30
- ๐(Long Term Project) Handling early exercise feature.
- ๐(Short Term Project) Working on a C++/Python API library.
- ๐(Issue) Checking why remote database connection takes so long
- ๐(Misc) Making a time ladder: produce a grid of price for a set of dates
๐ Achievements
- 2024-01-07
- ๐(Long Term Project) Implemented Either structure: Contract buyer or seller can make choices during the contract lifetime.
- ๐(Short Term Project) Implemented PDE pricer framework, Romberg-Richardson extrapolation and theta schemes.
- ๐(Issue) Removed warnings and turned warnings to errors at compile-time
- ๐(Misc) Implemented qapy, a python project to design and generate your contract.
๐ Table of Contents
- ๐ฅ Genesis
- โก๏ธ Quick Start
- ๐ด Features
- ๐ List of features
- ๐ค Missing a specific feature ?
- ๐ Found a bug ?
- ๐ How can I contribute ?
- ๐ป Insights
- ๐ฏ Developement
- ๐ Build
- ๐ Tests
- ๐ Continuous Integration
- ๐ Continuous Delivery
- ๐ Licence
Genesis
QA-Quantitative Analytics
is an ecosystem of projects that helps you with designing, pricing and monitoring your own derivatives.
- qacore (private) -- The core library of the project that is the agregation of embedded libraries in charge of implementing contract, data, models and pricers architectures. Its codebase is hosted on a private GitHub repository which access is restricted to our developpers only.
- **qapi** (public) -- `qa` provides a C++/python API to run your analysis: For example, you can inspect your contract features, compute its price together with greeks, run (multidimensional) scenario and contractual feature ladder/solver, plug and inspect your own market data select a financial model and inspect its characteristics ...
- **qapp** (public) -- The GUI desktop application that requests `qapi` to run your analysis and visualize the results within a nice graphical interface !
- **qalgebra** (public) -- `qacore` uses the power of algebraic contract description and `qalgebra` is the python component that implements it: A customized language easily understandable by human and machine to design your contract from a self-explanatory script. Thanks to qalgebra, the user can write down a contract using this simple language. The whole `qa` ecosystem is built arround `qalgebra` device.
โก๏ธ Quick Start
To download the latest version of our application, go to Releases and download the asset that corresponds to your operating system. After extracting all the files into a nice location of your machine, you are falling onto a folder that contains qa
directory. Open the qapp
executable located at qa/bin and you arrive to the main page.
On the left hand side of the screen is located a logger that displays the messages that qacore
returns after each actions.
Each action triggers by qapp
- typically pressing a button - throws information, warnings, errors and/or exceptions.
- If an exception is thrown, it means something went wrong dev side. In that case please report your issue by dropping your
mockup
file together with your contract and data json files if any (see How can I report my issue). - If an error is thrown, it means that something went wrong user side and
qacore
did not manage to perform your request. In that case you need to check the log and correct your request accordingly. - If a warning is thrown, it means that something went wrong user side but
qacore
managed to perform the request. At inception, an action always thrown an information message to the user such as "Pricing contract...", the goal is to inform what actionqapp
is performing. When the action is over, a success is thrown if an only if no error or exception occured during the action lifetime.
๐ด Features
๐ List of features
- ๐บ Dictionary
- ๐บ How can I design my contract ?
๐ค Missing a specific feature ?
The project is very far from being complete (and will probably never be ...) and a loads of features are still missing. This is why our developpers are working continuously to enrich the list of available functionalities. Feel free to share your ideas under the tag features ! We are happy to discuss with you about your personnal needs and the feasibility of your project.
[!NOTE] If your idea is considered as doable by our team, be sure that your request will be added to our stack. But please kindly understand that we cannot give any ETA since our developers are working for
qa
as volunteers aside their job and our backlog is already populated by a thousand of new fields to explore.
๐ Found a bug ?
Feel free to report your issue (see How can I report my issue) with a respective title and an understandable description. For any questions, you can always reach out to us directly via our twitter or post your question on QuantStackExchange with the official qa
tag.
[!IMPORTANT]
qa
embbeds a mecanism to save and open your currentmockup
for further usage. If possible please attach yourmockup
file together with the relevant data json and contract external files in your issue, it helps our developpers to reproduce the bug and increase the chances for us to sort it quickly. See How can I report my issue for further details on how to proceed.
๐ How can I contribute ?
We are building a payoff base to:
- Challenge our tool and push it to its limits.
- Enhance our unit and integration tests.
We propose to every structured products and programmer enthusiasts to contribute its favorite payoff within a shared folder. Here is the process to follow:
-
Design your contract (see How can I design my contract)
-
Fork and clone this repository.
git clone https://github.com/matt-charr/qa-demo.git
- Drop your contract python file(s) into qa-demo/factory folder.
mv my_contract.py qa-demo/factory/my_contract.py
- Commit, push and pull request.
cd qa-demo
git commit -am "Added my contract"
git push origin master
๐ป Insights
๐ฏ Developement
Once a bug or a feature is submitted, an issue is created with the corresponding flag (bug, feature, short project, long project, misc). Once picked from the stack, a dev branch is created, comes down locally to the developper machine and this is where the fun begins ๐
๐ Build
qa
uses CMake as a build system and has its main code base located on a private repository which access is restricted to our developers only. Besides, it relies on a bunch of repository dependencies that are required at qa
build time.
It is to the following projects that we owe our heartfelt thanks for their generous open source contribution.
To load the below dependencies, qa
uses the power of superbuild feature from CMake. For that purpose, an embedded CMake project is in charge of cloning, building and installing all the dependencies that qa
requires into a specific folder. That's pretty cool, isn't it ? ๐
๐ Tests
In order to ensure that the code change effect is not broken by any subsequent modifications, at the end of each dev session, a new unit test is required to be submitted to the test suite together with a contract file that replicates the expected behavior of the code change.
๐ Continuous Integration
qa
embbeds a custom GitHub action that runs at each pull requests. Once a pull request is submitted, build and tests are triggered on our Windows, Linux and MacOS self-hosted runners in Debug/Release mode with the below configurations. A dev branch is merged if and only if all builds and tests passed on all configurations.
Name | OS | Configuration | RAM | CMake | CMake Generator | Architecture | Build Type | Compiler | Build Status |
---|---|---|---|---|---|---|---|---|---|
Windows-Release | Windows 10 Pro 22H2 19045.3930 | Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz 2.11 GHz | 8.00 GB | CMake-3.27.2 | MinGW Makefiles | x64 | Release | GCC-13.2.0 | โ |
Windows-Debug | Windows 10 Pro 22H2 19045.3930 | Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz 2.11 GHz | 8.00 GB | CMake-3.27.2 | Visual Studio 17 2022 | x64 | Debug | MSVC-19.30.30709.0 | โ |
Linux-Release | Ubuntu 22.04 64bit | AMD EPYC 7543P 32-Core Processor | 8.00 GB | CMake-3.22.1 | Unix Makefiles | x86_64 | Release | GCC-11.4.0 | โ |
Linux-Debug | Ubuntu 22.04 64bit | AMD EPYC 7543P 32-Core Processor | 8.00 GB | CMake-3.22.1 | Unix Makefiles | x86_64 | Debug | GCC-11.4.0 | โ |
MacOS-Release | Coming soon | Coming soon | Coming soon | Coming soon | Unix Makefiles | Coming soon | Release | Coming soon | โ |
MacOS-Debug | Coming soon | Coming soon | Coming soon | Coming soon | Xcode | Coming soon | Debug | Coming soon | โ |
[!NOTE]
qa
has subscribed to a remote VPS (KVM2 plan - 100Go) provided by Hostinger to run builds, tests and deployment on Linux. We could not find any server providers to run our builds and tests on MacOS and are listening to any suggestions ๐.
๐ Continuous Delivery
Our team delivers a release on a weekly basis:
- ~One major release per year (coming out with the current long project)
- ~One minor release per month (coming out with the current short project)
- ~One patch release per week (coming out with the current issue)
To publish a new release, each tag created on our developement repository triggers a github actions that for each OS supported will create and upload the package to qa-demo. Here are the configurations on which we deploy our package:
Name | OS | Configuration | RAM | CMake | CMake Generator | Architecture | Build Type | Compiler | Build Status |
---|---|---|---|---|---|---|---|---|---|
Windows | Windows 10 Pro 22H2 19045.3930 | Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz 2.11 GHz | 8.00 GB | CMake-3.27.2 | MinGW Makefiles | x64 | Release | GCC-13.2.0 | โ |
Linux | Ubuntu 22.04 64bit | AMD EPYC 7543P 32-Core Processor | 8.00 GB | CMake-3.22.1 | Unix Makefiles | x86_64 | Release | GCC-11.4.0 | โ |
MacOS | Coming soon | Coming soon | Coming soon | Coming soon | Unix Makefiles | Coming soon | Release | Coming soon | โ |
[!IMPORTANT] We are far from being CD experts and know that our solution looks like a rush, better ways of releasing probably exist such as deploying binaries to a more convenient location than GitHub or building on a dedicated production environement. You are more than welcome to suggest improvements or just simply share your CD work styles.
๐ Licence
Copyright ยฉ 2023 QA - Quantitative Analytics. All rights reserved.
This file is part of the project QA - Quantitative Analytics.
Hence the latter remains the exclusive property of its author.
Accordingly, no part of this document may be used or transmitted
in any form for professional, educational or commercial purposes
without the express permission of Matthieu Charrier.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.