Skip to main content

Python components for QA: Design your contract with the algebra. Monitor and price it with the API

Project description



Twitter Twitch Linkedin GitHub
C C++ MariaDB
Windows Linux MacOS
GitHubActions Hostinger

๐Ÿบ 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

  1. ๐Ÿ’ฅ Genesis
  2. โšก๏ธ Quick Start
  3. ๐ŸŒด Features
    1. ๐Ÿ“ List of features
    2. ๐Ÿค Missing a specific feature ?
    3. ๐Ÿ”Ž Found a bug ?
  4. ๐Ÿ™Œ How can I contribute ?
  5. ๐Ÿ’ป Insights
    1. ๐Ÿฏ Developement
    2. ๐Ÿ Build
    3. ๐ŸŠ Tests
    4. ๐Ÿˆ Continuous Integration
    5. ๐Ÿ‡ Continuous Delivery
  6. ๐Ÿ“œ Licence

Genesis

"Design, price and monitor your own exotic financial derivatives contracts"

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 action qapp 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

  1. ๐Ÿ“บ Dictionary
  2. ๐Ÿ“บ 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 current mockup for further usage. If possible please attach your mockup 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:

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qapy-0.1.3.tar.gz (18.7 kB view hashes)

Uploaded Source

Built Distribution

qapy-0.1.3-py3-none-any.whl (13.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page