menu
Data

Data Coordinates

DataCoordinate is an object which uses a coordinate system for creating a reference to a data series. The object is immutable and hashable, so they can be applied in caching, streaming, and other applications where mapping the coordinates may be important. DataCoordinates can also be utilized to fetch the series defined by the coordinate.

DataCoordinate Class

Below is an example of fetching implied volatility for AAPL UW using the Marquee assetId.

info

Note

Examples require an initialized GsSession and relevant identifier licenses. Please refer to Sessions for details.

import datetime as dt

from gs_quant.data import DataDimension, DataCoordinate, DataMeasure, DataFrequency

dimensions = {
    'assetId': 'MA4B66MW5E27U9VBB94',  # AAPL UW
    DataDimension.TENOR: '1m',
    DataDimension.STRIKE_REFERENCE: 'spot',
    DataDimension.RELATIVE_STRIKE: .8
}

coordinate = DataCoordinate(measure=DataMeasure.IMPLIED_VOLATILITY,
                            dataset_id='EDRVOL_PERCENT_STOCK_STANDARD',
                            dimensions=dimensions)

coordinate.get_series(start=dt.date(2020, 1, 2), end=dt.date(2020, 1, 8))

Output:

2020-01-02    0.399873
2020-01-03    0.402368
2020-01-06    0.394695
2020-01-07    0.392863
2020-01-08    0.372748
dtype: float64

Get a DataCoordinate from an Entity

Using an Entity object, such as an Asset object, you can get a DataCoordinate using the get_data_coordinate method. With this DataCoordinate, a series can be fetched without explicitly specifying the dataset ID. You can get the mapped dataset via the dataset_id property on the resolved coordinate.

import datetime as dt

from gs_quant.data import DataDimension, DataCoordinate, DataMeasure, DataFrequency
from gs_quant.markets.securities import SecurityMaster, AssetIdentifier

dimensions = {
    DataDimension.TENOR: '1m',
    DataDimension.STRIKE_REFERENCE: 'spot',
    DataDimension.RELATIVE_STRIKE: .8
}

spx = SecurityMaster.get_asset('SPX', AssetIdentifier.BLOOMBERG_ID)
coordinate: DataCoordinate = spx.get_data_coordinate(measure=DataMeasure.IMPLIED_VOLATILITY,
                                                     dimensions=dimensions,
                                                     frequency=DataFrequency.DAILY)

print(f'Dataset ID: {coordinate.dataset_id}')

coordinate.get_series(start=dt.date(2020, 1, 1), end=dt.date(2020, 1, 8))

Output:

Dataset ID: EDRVOL_PERCENT_V1_STANDARD

2020-01-02    0.300644
2020-01-03    0.315498
2020-01-06    0.311003
2020-01-07    0.306926
2020-01-08    0.308256
dtype: float64

Comparable and Hashable

DataCoordinates are comparable and hashable objects which allow them to be conveniently compared for equality and mapped for caching and streaming purposes.

dimensions_a = {
    DataDimension.TENOR: '1m',
    DataDimension.STRIKE_REFERENCE: 'spot',
    DataDimension.RELATIVE_STRIKE: .8
}

# Same dimensions but different order
dimensions_b = {
    DataDimension.RELATIVE_STRIKE: .8,
    DataDimension.STRIKE_REFERENCE: 'spot',
    DataDimension.TENOR: '1m'
}

coord_a = DataCoordinate('EDRVOL_PERCENT_STOCK_STANDARD',
                         DataMeasure.IMPLIED_VOLATILITY,
                         dimensions_a)

coord_b = DataCoordinate('EDRVOL_PERCENT_STOCK_STANDARD',
                         DataMeasure.IMPLIED_VOLATILITY,
                         dimensions_b)

assert coord_a == coord_b # True
assert hash(coord_a) == hash(coord_b) # True

Related Content


This site is for informational purposes only and does not constitute an offer to sell, or the solicitation of an offer to buy, any security. The Goldman Sachs Marquee® platform is for institutional and professional clients only. Some of the services and products described on this site may not be available in certain jurisdictions or to certain types of client. Please contact your Goldman Sachs sales representative with any questions. Nothing on this site constitutes an offer, or an invitation to make an offer from Goldman Sachs to purchase or sell a product. This site is given for purely indicative purposes and does not create any contractual relationship between you and Goldman Sachs. Any market information contained on the site (including but not limited to pricing levels) is based on data available to Goldman Sachs at a given moment and may change from time to time. There is no representation that any transaction can or could have been effected on such terms or at such prices. Please see https://www.goldmansachs.com/disclaimer/sec-div-disclaimers-for-electronic-comms.html for additional information. © 2023 Goldman Sachs. All rights reserved.
Transaction Banking services are offered by Goldman Sachs Bank USA (“GS Bank”). GS Bank is a New York State chartered bank, a member of the Federal Reserve System and a Member FDIC. © 2023 Goldman Sachs. All rights reserved.
Not all products and functionality mentioned on this website are currently available through our API platform.
All loans and deposit products are provided by Goldman Sachs Bank USA, Salt Lake City Branch. Member FDIC.
Brokerage and investment advisory services offered by our investment products are provided by Goldman Sachs & Co. LLC (`‘GS&CO.`’), which is an SEC registered broker-dealer and investment adviser, and member FINRA/SIPC. Research our firm at FINRA's BrokerCheck. Custody and clearing services are provided by Apex Clearing Corporation, a registered broker-dealer and member FINRA/SIPC. Please consider your objectives before investing. A diversified portfolio does not ensure a profit or protect against a loss. Past performance does not guarantee future results. Investment outcomes and projections are forward-looking statements and hypothetical in nature. Neither this website nor any of its contents shall constitute an offer, solicitation, or advice to buy or sell securities in any jurisdictions where GS&Co. is not registered. Any information provided prior to opening an investment account is on the basis that it will not constitute investment advice and that GS&Co. is not a fiduciary to any person by reason of providing such information. For more information about our investment offerings, visit our Full Disclosures.
Investment products are: NOT FDIC INSURED ∙ NOT A DEPOSIT OR OTHER OBLIGATION OF, OR GUARANTEED BY, GOLDMAN SACHS BANK USA ∙ SUBJECT TO INVESTMENT RISKS, INCLUDING POSSIBLE LOSS OF THE PRINCIPAL AMOUNT INVESTED