Git Product home page Git Product logo

gs-quant's Introduction

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: [email protected]

gs-quant's People

Contributors

nick-young-gs avatar stephen-183 avatar andrewphillipsn avatar robertoronderosjr avatar gg4real avatar scottweinstein avatar ehoffm03 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.