GS Quant is a Python toolkit for quantitative finance, created on top of one of the world’s most powerful risk transfer platforms. Designed to accelerate development of quantitative trading strategies and risk management solutions, crafted over 25 years of experience navigating global markets.
from gs_quant.data import Dataset
# Dataset for equity implied volatility
vol_dataset = Dataset(Dataset.GS.EDRVOL_PERCENT_SHORT)
# Get S&P 500 1m at-the-money-forward volatility
vol_data = vol_dataset.get_data(
ticker='SPX',
tenor='1m',
strikeReference='forward',
relativeStrike=1
)
# Show last few values
vol_data.tail()
GS Quant provides access to our proprietary derivatives pricing models and market dynamics. Compute prices and sensitivities through our risk engines, and apply complex shocks and scenarios. Fully documented instrument and risk coverage makes structuring and portfolio analytics painless.
from gs_quant.instrument import IRSwap, Currency, PayReceive
from gs_quant.risk import IRDelta
# Create 10y dollar swap
swap = IRSwap(PayReceive.Pay, "10y", Currency.USD)
# Use historical market
with(PricingContext(market_data_as_of=date(2019,4,1))):
# Compute derivative price
price = swap.price()
# Calculate rates delta
delta = swap.calc(IRDelta)
from gs_quant.session import GsSession, Environment
from gs_quant.markets.securities import AssetClass
from gs_quant.api.gs.trades import GsTradesApi
from datetime import date
# Authenticate to our trading APIs
GsSession.use(client_id, secret)
# List recent trades
trades = GsTradesApi.get_trades(AssetClass.FX, date(2019,1,1), date.today())
# Get unit price
price = trades[0].unitPrice