Skip to main content

Derivatives Pricing Engine

Project description

DerivX

V0.3.1-Beta Build 20210903

© 2021-2021 Xu Rendong. All Rights Reserved.

Project Summary

Derivatives Pricing Engine.

  • Plain Vanilla European / American options portfolio calculation.
  • Plain Vanilla European / American option pricing and greek value calculation.
  • Exotic Autocall Phoenix / Snowball option pricing and greek value calculation.
  • Interfaces and examples for C++, Python, JavaScript.

Install

C++:

Python:
pip install derivx
JavaScript:
npm install derivx

Usage

C++:

Python:
import derivx
print(derivx.Version())

For more usages please refer to examples in derivx_py folder.

DerivX is not dependent on numpy, pandas and matplotlib, but if you want to run examples, you'd better install them with:

pip install numpy pandas matplotlib
JavaScript:
const derivx = require('derivx')
console.log(derivx.Version())

For more usages please refer to examples in derivx_js folder.

DerivX is not dependent on numjs, but if you want to run examples, you'd better install it with:

npm install git+https://github.com/nicolaspanel/numjs.git

Benchmark

Environment:
Module Specification
CPU Intel Core i7-4790 4C/8T 3.60GHz
RAM 16.0GB DDR3 800MHz Dual
SYS Windows 10 Pro 64-bit 20H2 19042.1110
Parameters:
Parameter Value
rand_rows 500000
rand_cols 250
rand_seed { 0, 1, 2, 3, 4, 5, 6, 7 }
dual_smooth true
runs_size 1000000
runs_step 244
run_from 0
run_days 1
C++:
Function Min Max
InitRand 461ms 550ms
InitPath 1575ms 1961ms

    Autocall Snowball:

Function Min Max Unit Note
CalcCoupon 468ms 564ms - 1
CalcPayoff 965ms 983ms per price -
CalcDelta 1932ms 1983ms per price -
CalcGamma 2898ms 2918ms per price -
CalcVega 2047ms 2073ms per price -
CalcTheta 1636ms 1647ms per price 2
CalcRho 2106ms 2161ms per price -
  1. There is still 200ms optimization space.
  2. As run_days increases this tends to CalcPayoff's time consumption.
  3. The difference between CalcCoupon and CalcPayoff shows that different prices and barriers will cause different time consumption.

Contact Information

QQ: 277195007, WeChat: xrd_ustc, E-mail: xrd@ustc.edu

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

derivx-0.3.1-cp39-cp39-win_amd64.whl (351.6 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

derivx-0.3.1-cp38-cp38-win_amd64.whl (351.5 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

derivx-0.3.1-cp37-cp37m-win_amd64.whl (350.5 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

derivx-0.3.1-cp36-cp36m-win_amd64.whl (350.6 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

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