# goldmansachs/gs-quant architecture

> Architecture diagram of the GitHub repository goldmansachs/gs-quant, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/goldmansachs/gs-quant
- Repository: https://github.com/goldmansachs/gs-quant

## Overview

GS Quant is a Python toolkit for quantitative finance: it supports market and reference-data access, instrument and portfolio analysis, risk management, statistical time-series work, and strategy backtesting. A typical workflow uses a configured session to request data, represents instruments and portfolios, then computes analytics or risk results; backtesting adds event-driven strategy execution. The graph highlights these product areas and the API/session layer. Evidence is limited to the README and supplied excerpts/SOURCE INDEX; unsampled subsystems are included only at documented or tree-supported scope, with uncertain links omitted.

Main entry points: [`gs_quant/markets/securities.py`](https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/markets/securities.py) (Securities), [`gs_quant/session.py`](https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/session.py) (API session), [`gs_quant/backtests/generic_engine.py`](https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/backtests/generic_engine.py) (Backtest engine), [`gs_quant/timeseries/measures.py`](https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/timeseries/measures.py) (Time-series measures)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API access"]
  node_session["API session<br/>[session.py]"]
  node_asset_api["Asset API<br/>[assets.py]"]
  node_data_api["Data API<br/>[data.py]"]
  node_portfolio_api["Portfolio API<br/>[portfolios.py]"]
end

subgraph group_market["Market objects"]
  node_data_model["Dataset queries<br/>[query.py]"]
  node_entities["Entities<br/>[entity.py]"]
  node_securities["Securities<br/>[securities.py]"]
  node_portfolio["Portfolios<br/>[portfolio.py]"]
  node_portfolio_manager["Portfolio management"]
  node_reports["Reports<br/>[report.py]"]
end

subgraph group_analytics["Analytics and risk"]
  node_timeseries["Time-series measures<br/>[measures.py]"]
  node_time_ops["Time operations<br/>[datetime.py]"]
  node_analytics_processors["Analytics processors"]
  node_analytics_grid["Analytics grids<br/>[datagrid.py]"]
  node_risk_models["Risk models<br/>[risk_model.py]"]
  node_risk_results["Risk results<br/>[results.py]"]
end

subgraph group_strategy["Strategy research"]
  node_backtest_engine["Backtest engine<br/>[generic_engine.py]"]
  node_backtest_actions["Strategy actions<br/>[actions.py]"]
  node_backtest_data["Backtest data<br/>[data_handler.py]"]
end

subgraph group_foundation["Shared foundation"]
  node_base_types["Typed objects<br/>[base.py]"]
end

node_quant_user(("Quant developer"))
node_gs_platform(("GS platform"))

node_quant_user -->|"configures"| node_session
node_session -->|"sends requests"| node_gs_platform
node_asset_api -->|"requests assets"| node_session
node_entities -->|"looks up entities"| node_session
node_securities -->|"uses asset services"| node_asset_api
node_securities -->|"uses data services"| node_data_api
node_data_model -->|"queries data"| node_session
node_timeseries -->|"requests observations"| node_data_api
node_timeseries -->|"uses securities"| node_securities
node_timeseries -->|"uses date operations"| node_time_ops
node_analytics_processors -.->|"analyzes series"| node_timeseries
node_analytics_grid -.->|"aggregates processors"| node_analytics_processors
node_risk_models -->|"uses securities"| node_securities
node_risk_models -.->|"produces risk results"| node_risk_results
node_portfolio_manager -->|"manages portfolios"| node_portfolio_api
node_portfolio_manager -->|"uses reports"| node_reports
node_portfolio_manager -->|"uses risk models"| node_risk_models
node_portfolio -.->|"contains instruments"| node_securities
node_backtest_engine -->|"dispatches actions"| node_backtest_actions
node_backtest_engine -->|"uses market data"| node_backtest_data
node_backtest_engine -->|"uses portfolios"| node_portfolio
node_backtest_engine -->|"uses risk results"| node_risk_results
node_base_types -->|"models objects"| node_data_model
node_base_types -->|"models results"| node_risk_results

click node_session "https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/session.py"
click node_asset_api "https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/api/gs/assets.py"
click node_data_api "https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/api/gs/data.py"
click node_portfolio_api "https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/api/gs/portfolios.py"
click node_data_model "https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/data/query.py"
click node_entities "https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/entities/entity.py"
click node_securities "https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/markets/securities.py"
click node_portfolio "https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/markets/portfolio.py"
click node_portfolio_manager "https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/markets/portfolio_manager.py"
click node_reports "https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/markets/report.py"
click node_timeseries "https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/timeseries/measures.py"
click node_time_ops "https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/timeseries/datetime.py"
click node_analytics_processors "https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/analytics/processors/analysis_processors.py"
click node_analytics_grid "https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/analytics/datagrid/datagrid.py"
click node_risk_models "https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/models/risk_model.py"
click node_risk_results "https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/risk/results.py"
click node_backtest_engine "https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/backtests/generic_engine.py"
click node_backtest_actions "https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/backtests/actions.py"
click node_backtest_data "https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/backtests/data_handler.py"
click node_base_types "https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/base.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_session,node_asset_api,node_data_api,node_portfolio_api toneBlue
class node_data_model,node_entities,node_securities,node_portfolio,node_portfolio_manager,node_reports toneAmber
class node_timeseries,node_time_ops,node_analytics_processors,node_analytics_grid,node_risk_models,node_risk_results toneMint
class node_backtest_engine,node_backtest_actions,node_backtest_data toneRose
class node_base_types,node_quant_user,node_gs_platform toneIndigo
```

## Components

### API access

- [API session](https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/session.py): `gs_quant/session.py`
- [Asset API](https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/api/gs/assets.py): `gs_quant/api/gs/assets.py`
- [Data API](https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/api/gs/data.py): `gs_quant/api/gs/data.py`
- [Portfolio API](https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/api/gs/portfolios.py): `gs_quant/api/gs/portfolios.py`

### Market objects

- [Dataset queries](https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/data/query.py): `gs_quant/data/query.py`
- [Entities](https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/entities/entity.py): `gs_quant/entities/entity.py`
- [Securities](https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/markets/securities.py): `gs_quant/markets/securities.py`
- [Portfolios](https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/markets/portfolio.py): `gs_quant/markets/portfolio.py`
- [Portfolio management](https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/markets/portfolio_manager.py): `gs_quant/markets/portfolio_manager.py`
- [Reports](https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/markets/report.py): `gs_quant/markets/report.py`

### Analytics and risk

- [Time-series measures](https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/timeseries/measures.py): `gs_quant/timeseries/measures.py`
- [Time operations](https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/timeseries/datetime.py): `gs_quant/timeseries/datetime.py`
- [Analytics processors](https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/analytics/processors/analysis_processors.py): `gs_quant/analytics/processors/analysis_processors.py`
- [Analytics grids](https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/analytics/datagrid/datagrid.py): `gs_quant/analytics/datagrid/datagrid.py`
- [Risk models](https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/models/risk_model.py): `gs_quant/models/risk_model.py`
- [Risk results](https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/risk/results.py): `gs_quant/risk/results.py`

### Strategy research

- [Backtest engine](https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/backtests/generic_engine.py): `gs_quant/backtests/generic_engine.py`
- [Strategy actions](https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/backtests/actions.py): `gs_quant/backtests/actions.py`
- [Backtest data](https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/backtests/data_handler.py): `gs_quant/backtests/data_handler.py`

### Shared foundation

- [Typed objects](https://github.com/goldmansachs/gs-quant/blob/master/gs_quant/base.py): `gs_quant/base.py`

### Other components

- **Quant developer**
- **GS platform**

## Connections

- Quant developer → API session: configures (evidence: `README.md`)
- API session → GS platform: sends requests (evidence: `gs_quant/session.py`)
- Asset API → API session: requests assets (evidence: `gs_quant/api/gs/assets.py`)
- Entities → API session: looks up entities (evidence: `gs_quant/entities/entity.py`)
- Securities → Asset API: uses asset services (evidence: `gs_quant/markets/securities.py`)
- Securities → Data API: uses data services (evidence: `gs_quant/markets/securities.py`)
- Dataset queries → API session: queries data (evidence: `gs_quant/data/query.py`)
- Time-series measures → Data API: requests observations (evidence: `gs_quant/timeseries/measures.py`)
- Time-series measures → Securities: uses securities (evidence: `gs_quant/timeseries/measures.py`)
- Time-series measures → Time operations: uses date operations (evidence: `gs_quant/timeseries/measures.py`)
- Analytics processors → Time-series measures: analyzes series
- Analytics grids → Analytics processors: aggregates processors
- Risk models → Securities: uses securities (evidence: `gs_quant/models/risk_model.py`)
- Risk models → Risk results: produces risk results
- Portfolio management → Portfolio API: manages portfolios (evidence: `gs_quant/markets/portfolio_manager.py`)
- Portfolio management → Reports: uses reports (evidence: `gs_quant/markets/portfolio_manager.py`)
- Portfolio management → Risk models: uses risk models (evidence: `gs_quant/markets/portfolio_manager.py`)
- Portfolios → Securities: contains instruments
- Backtest engine → Strategy actions: dispatches actions (evidence: `gs_quant/backtests/generic_engine.py`)
- Backtest engine → Backtest data: uses market data
- Backtest engine → Portfolios: uses portfolios (evidence: `gs_quant/backtests/generic_engine.py`)
- Backtest engine → Risk results: uses risk results (evidence: `gs_quant/backtests/generic_engine.py`)
- Typed objects → Dataset queries: models objects (evidence: `gs_quant/base.py`)
- Typed objects → Risk results: models results
