Skip to main content

Goldman Sachs Quant

Project description

GS Quant

GS Quant is a Python toolkit for quantitative finance, which provides access to derivatives pricing and risk capabilities through the Goldman Sachs developer APIs, as well as standalone packages for financial analytics.

It is created and maintained by quantitative developers (quants) at Goldman Sachs to enable the development of trading strategies and analysis of derivative products. GS Quant can be used to facilitate derivative structuring, trading, and risk management, or as a set of statistical packages for data analytics applications.

See also Getting Started notebook in the gs_quant folder or package.

Requirements

  • Python 3.6 or greater
  • Access to PIP package manager

You can verity your Python version with the command python --version.

Any Python-ready IDE will work. However, most of our team uses PyCharm.

Installation

pip install gs-quant

GS users:

pip install gs-quant[internal] --user

Examples

The following example generates a random timeseries and computes 1-month (22 day) rolling realized volatility:

import gs_quant.timeseries as ts

x = ts.generate_series(1000)           # Generate random timeseries with 1000 observations
vol = ts.volatility(x, Window(22, 0))  # Compute realized volatility using a window of 22 and a ramp up value of 0
vol.tail()                             # Show last few values

Out:

Out[1]:
2021-12-20 12.898025
2021-12-21 12.927230
2021-12-22 12.929520
2021-12-23 13.987033
2021-12-24 14.048165
dtype: float64

Clients of Goldman Sachs have access to a wide array of data through our developer APIs (please contact your sales coverage for details):

from gs_quant.session import Environment, GsSession
from gs_quant.data import Dataset, Fields
from datetime import date

with GsSession.get(Environment.PROD, <client_id>, <client_secret>, scopes=('read_product_data')):

    basket_ds = Dataset(Dataset.GS.CB)
    start_date = date(2007,1,1)

    vip_px = basket_ds.get_data_series(Fields.CLOSE_PRICE, start=start_date, ticker='GSTHHVIP')
    vip_px.tail()

Entitled users can also access pricing and risk engines programmatically:

from gs_quant.instrument import IRSwap
from gs_quant.common import Currency, PayReceive
import gs_quant.risk as risk

with GsSession.get(Environment.PROD, <client_id>, <client_secret>, scopes=('read_product_data','run_analytics')):

    # price an interest rate swap and compute its bucketed delta
    irs = IRSwap(PayReceive.Pay, "5y", Currency.USD, fixed_rate=0.0275)
    pv = irs.price()
    ir_delta = irs.calc(risk.IRDelta)

Contributions

Contributions are encouraged! Please see CONTRIBUTING.MD for more details

Help

If you need any help or have feedback, please email us at: gs-quant@gs.com

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

gs_quant-0.8.82.tar.gz (329.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gs_quant-0.8.82-py3-none-any.whl (402.6 kB view details)

Uploaded Python 3

File details

Details for the file gs_quant-0.8.82.tar.gz.

File metadata

  • Download URL: gs_quant-0.8.82.tar.gz
  • Upload date:
  • Size: 329.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for gs_quant-0.8.82.tar.gz
Algorithm Hash digest
SHA256 834d127ad33a5209a70d2de0eb5b776967a445a4cedb9fdef4116918580b5c5d
MD5 3a27154769f129cdad219fbb815d2b8d
BLAKE2b-256 17400a0006af289a7bd6ba4b5afb79c528dee3f26138c67d2141dede1267397a

See more details on using hashes here.

File details

Details for the file gs_quant-0.8.82-py3-none-any.whl.

File metadata

  • Download URL: gs_quant-0.8.82-py3-none-any.whl
  • Upload date:
  • Size: 402.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for gs_quant-0.8.82-py3-none-any.whl
Algorithm Hash digest
SHA256 f86d924ea6fceb94f3467dd3cd0b5c30b5f147425e80f96b4a26d8020d3e019b
MD5 92351fd0b567a668590c65c77d755152
BLAKE2b-256 41213067a64f11278790cd2814b1ecbf472df668cc3ed2dad5871eee0ccfa526

See more details on using hashes here.

Supported by

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