Skip to main content

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

Project description

QA

Design, monitor and price your own financial contracts.

๐Ÿบ Project Status

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

โญ Star the project on GitHub helps it to progress.

๐Ÿ“ฐ Latest news

  • 2024-01-07
    • ๐Ÿ””(Release) qa-v0.2.0 is out ๐Ÿš€

๐Ÿ‘ท Current work

  • 2024-01-07
    • ๐Ÿ“—(Long Term Project) Handling early exercise feature.
    • ๐Ÿ“™(Short Term Project) Working on a C++ API library.
    • ๐Ÿ“˜(Misc) Making a contract feature(s) solver.
    • ๐Ÿ“•(Issue) Checking why remote database connection takes so long

๐Ÿ† Achievements

  • 2024-01-07
    • ๐Ÿ“—(Long Term Project) Implemented orthogonal polynomials framework together with quadratures techniques.
    • ๐Ÿ“™(Short Term Project) Implemented PDE pricer framework, Romberg-Richardson extrapolation and theta schemes.
    • ๐Ÿ“˜(Misc) Implemented intraday fixings, payments and exercises.
    • ๐Ÿ“•(Issue) Identified stack overflow issue for deep conditionnal contracts (ex: 10y daily convertible bond)

๐Ÿ“‹ Table of Contents

  1. ๐Ÿ’ฅ Introduction
  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

๐Ÿ’ฅIntroduction

QA-Quantitative Analytics is an ecosystem of components that helps you with designing, monitoring and pricing your own financial derivatives.

  • qacore (private) -- The core library of the project that is the agregation of embedded libraries in charge of implementing contract, data, modeling and pricing engine.

  • qapp (public) -- The GUI desktop application through which the user can interact with qacore and send all kind of request such as pricing a contract, feed a database, see model calibration results, inspect the contract lifetime events and much more.

  • qalgebra (private) -- qacore uses the power of algebraic contract description and qalgebra is the library that implements it: A customized language easily understandable by human and machine to design your contract with a self-explanatory script. Thanks to qalgebra, the user can write down a contract using this simple language and send it to qa to run any generic actions such as pricing, monitoring and much more. The whole qa ecosystem is built arround qalgebra device.

  • qafactory (public) -- For the users to benefit their own qalgebra experience and price their own contracts, our developpers created qa-factory, a friendly repository where all programmer enthusiasts can use and contribute its favorite payoff functions and contracts to eventually use it from qapp. This game room is yours, feel free to populate and use it at your convenience.

โšก๏ธ 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. ๐Ÿ“บ How can I report my issue ?
  2. ๐Ÿ“บ How can I build my contract ?
  3. ๐Ÿ“บ How can I load my contract ?
  4. ๐Ÿ“บ How can I move my contract ?
  5. ๐Ÿ“บ How can I edit my fixings ?
  6. ๐Ÿ“บ How can I manage my data sources ?
  7. ๐Ÿ“บ How can I feed my data sources ?
  8. ๐Ÿ“บ How can I display my observable ?
  9. ๐Ÿ“บ How can I price my contract with Monte Carlo ?
  10. ๐Ÿ“บ How can I inspect my Monte Carlo ?

๐Ÿค 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! 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 files and contract cpp/json files in your issue, it helps our developpers to reproduce the bug and increase the chances for us to be sort it quickly. See How can I report my issue ? for further details on how to proceed.

๐Ÿ™Œ How can I contribute ?

qa-factory is a repository where you can:

  • Contribute your payoff functions (src/ and include/) and your contracts (tests/).
  1. Fork the repo.
  2. Clone your fork.
# clone qa-factory repository.
git clone https://github.com/matt-charr/qa-factory.git
  1. Make your masterpeace.
  2. Submit your pull request.
  • Use additionnal features (functions) provided by other users to ease your contract design.

In order to do this, you just need to clone it inside your factory directory.

# go to factory.
cd factory &&

# clone qa-factory repository.
git clone https://github.com/matt-charr/qa-factory.git

๐Ÿ’ป Insights

๐Ÿฏ Developement

Once a bug or a new feature is submitted, an issue is created with the corresponding flag (bug, feature, project, creation). 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 developpement/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

At the end of each dev session, a new unit test is required to be submitted to the test suite together with a contract json file that replicates the expected behavior of the code change. To ensure that the code change effect is not broken by any subsequent modifications, we use the service of GTest as a testing framework.

๐Ÿˆ 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 and Linux 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 CMake Generator Architecture Build Type Compiler Status
Windows-Release windows-latest CMake-3.27.2 MinGW Makefiles x64 Release GCC-13.2.0 โœ…
Windows-Debug windows-latest CMake-3.27.2 Visual Studio 17 2022 x64 Debug MSVC-19.30.30709.0 โœ…
Linux-Release ubuntu-latest CMake-3.22.1 Unix Makefiles x64 Release GCC-11.4.0 โœ…
Linux-Debug ubuntu-latest CMake-3.22.1 Unix Makefiles x64 Debug GCC-11.4.0 โœ…
MacOS-Release macos-latest Unix Makefiles x64 Release โŒ
MacOS-Debug macos-latest Xcode x64 Debug โŒ

[!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 project)
  • ~One minor release per month (coming out with the current feature)
  • ~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 CMake Generator Architecture Build Type Compiler Status
Windows-Release windows-latest CMake-3.27.2 MinGW Makefiles x64 Release GCC-13.2.0 โœ…
Linux-Release ubuntu-latest CMake-3.22.1 Unix Makefiles x64 Release GCC-11.4.0 โœ…
MacOS-Release macos-latest Unix Makefiles x64 Release โŒ

[!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.1.tar.gz (18.6 kB view hashes)

Uploaded Source

Built Distribution

qapy-0.1.1-py3-none-any.whl (13.1 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