JaxFin is a powerful and versatile Python library designed for pricing exotic options using a range of advanced financial techniques.
Project description
JaxFin
JaxFin
is a powerful and versatile Python library designed for pricing exotic options using a range of advanced financial techniques. The library is built with the aim of providing a robust, flexible, and efficient tool for quantitative finance professionals, researchers, and students alike. It offers a comprehensive suite of features that allow users to model, price, and analyze a wide variety of exotic options.
The core strength of JaxFin
lies in its use of the jax library. Jax is a high-performance library for accelerated array computing, offering features such as automatic differentiation (AutoGrad), accelerated linear algebra (XLA), and just-in-time compilation to GPU/TPU. By leveraging these capabilities, JaxFin
is able to perform complex financial computations with exceptional speed and efficiency.
Whether you're looking to price a complex exotic option, perform a large-scale Monte Carlo simulation, or simply explore advanced financial models, JaxFin
provides the tools and performance you need.
Table of Contents
Installation
You can install the project using pip:
pip install JaxFin
Quickstart
Here's a quick example of how to use the project:
import jax.numpy as jnp
from jaxfin.price_engine.black_scholes import european_price
# Black-Scholes price of an european option
spots = jnp.asarray([100])
strikes = jnp.asarray([110])
expires = jnp.asarray([1.0])
vols = jnp.asarray([0.2])
discount_rates = jnp.asarray([0.0])
print(european_price(spots, strikes, expires, vols, discount_rates, dtype=jnp.float32))
Building the Library Locally
To build the library locally, follow these steps:
- Clone the repository:
git clone https://github.com/username/project-name.git
- Navigate into the project directory:
cd JaxFin
- Install the build dependencies:
pip install -r requirements/build.txt
- Build the library:
python -m build
Sanity checks
Since we want to keep the library maintainable over the long run, this implies that code has to attain to certain standards. To achieve that the following scripts have been provided
scripts\run-pylint.bat
: This script runs Pylint, a tool that checks for errors in Python code, enforces a coding standard, and looks for code smells. It can also look for certain type errors, it can recommend suggestions about how particular blocks can be refactored and can offer you details about the code's complexity.scripts\run-tests.bat
: This script runs the unit tests for the project.scripts\run-mypy.bat
: This script runs Mypy, a static type checker for Python. Mypy can catch certain types of errors at compile time that would otherwise only be caught at runtime in standard Python. It's a way to get some of the benefits of static typing in a dynamically typed language.scripts\check-black.bat
: This script runs Black, the "uncompromising" Python code formatter. By using it, you ensure that your codebase has a consistent style, which can make it easier to read and maintain.
Contributing
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create your feature branch (
git checkout -b feature
) - Commit your changes (
git commit -am 'Add new feature'
) - Push to the branch (
git push origin feature
) - Create a new Pull Request
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file JaxFin-0.1.1.tar.gz
.
File metadata
- Download URL: JaxFin-0.1.1.tar.gz
- Upload date:
- Size: 24.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62325d56e13ba21a2983585aa0a069ccd2f75e6777ffd4c82d33424940503100 |
|
MD5 | a0ed671e7d7fb0e611bbb202c057ebd4 |
|
BLAKE2b-256 | 53d0ab0772be5ac8393ff5703dfd4e04ef31a1d31615560658b9c30eff7f611f |
File details
Details for the file JaxFin-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: JaxFin-0.1.1-py3-none-any.whl
- Upload date:
- Size: 11.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38e7663d6223d0b6fa4dc8b74f272e18987e5d6e1452609371fd0f9f433b5672 |
|
MD5 | aa32a62d9b5b0026d8fda610b4789612 |
|
BLAKE2b-256 | 48c1dd6211966d320b90f968b273998a8c42bf99480d4af9986d4d3f9d004148 |