Welcome to the main page for the Disent client library. Currently supports Python3.8.x+. Docs presume familiarly with basic python, pandas, numpy , and derivatives. π€&π€.
1 Quick-startο
Available on PyPi (link) via pip.
(venv) $ pip install disentpy
>>> import disent
>>> disent.example()
Downloaded........ 134.0 KiB done.
TCK MNY YRS IV T DT
0 AAPL 0.00 0.079452 0.791190 1M 2022-07-11T00:00:00
1 AAPL 0.00 0.164384 0.740517 2M 2022-08-11T00:00:00
.. ... ... ... ... ... ...
718 AAPL 2.95 7.002740 0.303335 7Y 2029-06-11T00:00:00
719 AAPL 2.95 10.005479 0.303335 10Y 2032-06-11T00:00:00
[720 rows x 6 columns]
When using disent.example() youβll get a pandas.DataFrame showing a modeled equity volatility surface derived from public domain AAPL options chains. This is a wrapper on disent.hub().
First time users will prompted for a security key:
>>> disent.example()
Key not found. See docs.
Do you have a permanent key (1) or would like you to request a temporary key (2):
See section on keys
2 Tutorialsο
The following walkthroughs will give users a flavor of Disentβs API capabilities and built in analytics.
2.1 Market Data Retrievalο
Use case βIβm a technologist at an asset manager, how can I pull modeled data out of Disent?β
When using disent.hub() youβll get a pandas.DataFrame:
>>> model="DEMO_EQD_VOLS"
>>> ticker = 'AAPL'
>>> model_args = {'ticker':ticker}
>>> df = disent.hub(model,model_args)
>>> df
TCK |
MNY |
YRS |
IV |
T |
DT |
|---|---|---|---|---|---|
AAPL |
0.00 |
0.079452 |
0.791190 |
1M |
2022-07-11T00:00:00 |
AAPL |
0.00 |
0.164384 |
0.740517 |
2M |
2022-08-11T00:00:00 |
β¦ |
β¦ |
β¦ |
β¦ |
β¦ |
β¦ |
AAPL |
2.95 |
7.002740 |
0.303335 |
7Y |
2029-06-11T00:00:00 |
AAPL |
2.95 |
10.005479 |
0.303335 |
10Y |
2032-06-11T00:00:00 |
Note
Various configurations and settings are available for enterprise subscribers. Below is describing the specifics of the DEMO_EQD_VOLS default model.
Descriptive columns
\(\text{TCK}s\) are the option contract root symbols using standard exchange root codes (OCC) root symbols.
\(\text{MNY}s\) are defined as \(f(S,K) = \displaystyle\frac{K}{S}\) bucketed into a pre-defined moneyness scale.
\(\text{T}s\) are rolling contract maturities, i.e. durations/tenors/time periods (akin to
datetime.timedelta), bucketed into a classic tenor scale:
1M |
3M |
6M |
1Y |
5Y |
10Y |
Across the Disent platform rolling tenors include two helpers:
\(\text{DT}s\) are expressed as ISO8601 strings as \(\text{ACT}\) days from today (\(t_0\)). Use
pandas.to_datetime()for conversion. \(\text{ACT}\) is \([t_0+T]\).
\(\text{YRS}s\) are the year fractions from today and \(\text{DT}\) using \(\text{ACT/365 Fixed}\) convention.
Evaluated columns
\(\text{IV}s\) is the implied volatility. It is derived using a Disent-specific implementation of Black-Scholes-Merton using spline-based interpolation.
Professional subscribers can access the advanced features here (click here).ο
2.2 Portfolio Valuationο
Use case βI manage a book at a fund, how can I load my book into Disent and get an on-the-fly full revaluation?β
(todo) Coming soon
2.3 Model integrationο
Use case βIβm a PhD researcher, I have a proprietary model for my firm written in C++, I would like to integrate it to Disent so that it can be coupled with our market/static data and deployed to my users.β
(todo) Coming soon
2.4 Scenario Analysisο
Use case βIβm a trader executing a risk-neutral strategy, I need to simulate the P&L on my book based on what-if scenarios in the spot price of a variety of assets. Iβll use the results as part of planning my hedging.ββ
(todo) Coming soon
2.5 Price an Exoticο
Use case βIβm on the phone with a client/dealer and weβre going back and forth on the price of a basket option. I want to pay around with the pricing parameters to try and see where a good level to close may be.β
(todo) Coming soon
2.6 Back-test a Strategyο
Use case βIβm in sales and a new client is asking for a specific type of enhanced yield. I want to impress, so letβs search out a strategy that makes money 99% of the time.β
(todo) Coming soon
3 Auth and Envsο
This section details how to request keys for application authentication as well as facilities for selecting which environments data is coming from (local/dev/prod, etc..).
3.1 Authentication keysο
Public users can generate generate keys to run the tutorials by entering their email address. We value your feedback!!!! Email us publickey@disent.com.
Professional subscribers see private documentation, call your rep, or just email us support@disent.com.
3.2 Environment selectionο
public (default)
3.2.1 List current environmentο
>>> disent.env.get()
public
3.2.2 Change (set) environmentο
>>> disent.set.set('prod')
public --> prod
4 API Referenceο
(todo) Coming soon