OpenAPI

To facilitate a better separation of instruments with different properties, Saxo Bank has decided to redefine the AssetType enumeration. In the following we will refer to this refined definition as "Extended AssetTypes".

IMPORTANT:

Please refer to the end of this article for how to try out extended asset types using a Pragma header. 

What are Extended AssetTypes?

Extended AssetTypes are created to make the AssetTypes more granular. The AssetType “Stock” contained not only equities, but also different types of funds. The universe became so big over time, creating the need to be more precise, for example when searching for instruments and handling them in a more specific (or correct) way. To support this we have now split the "old" AssetType "Stock" into “Stock”, “ETC” (Exchange-Traded Commodity), “ETF” (Exchange-Traded Funds), “ETN” (Exchange-Traded Notes), “Funds” and “Rights”. We have done the same for their "Cfd" and "Srd" equivalents.

This is an overview of all the new AssetTypes and their mapping to the old AssetTypes:

Current AssetType
Definition

Extended
AssetType
Definition

Example (Symbol/Identifier)
StockStockAAPL:xnas, 211
StockEtfIWDG:xlon, 8554006
StockEtcSGLD:xmil, 5708497
StockEtnTVIX:xnas, 528588
StockFund

APAX:xlon, 5410691

StockRights

CGCR:xasx, 23659770

CfdOnStockCfdOnStockAAPL:xnas, 211
CfdOnStockCfdOnEtfSPY:arcx, 36590
CfdOnStockCfdOnEtcOILB:xlon, 36077
CfdOnStockCfdOnEtnTVIX:xnas, 528588
CfdOnStockCfdOnFund

SMT:xlon, 4297

CfdOnStockCfdOnRights
SrdOnStockSrdOnStockSMT:xpar, 1252
SrdOnStockSrdOnEtfCAC:xpar, 9104

When your application calls OpenAPI, the API will check if your application has been configured to work with the new extended AssetType definition.

How to check if your app will be impacted by this

There are several ways to check whether this will impact your application. Below are some suggestions, but if you are still not sure, then feel free to reach out to openapisupport@saxobank.com with your AppKey and we can let you know.

You will NOT be impacted by this if either:

  1. you already know that you receive the new AssetTypes today, i.e. Etf, Etn, Etc, Funds or Rights, then your app is already enabled for Extended AssetTypes and don't need to make any changes.
  2. you don't trade or hold any instrument with AssetType of Stock today. Only the AssetTypes listed in the table above will be impacted, so for other instruments it doesn't matter; even if you haven't been enabled for Extended AssetTypes yet.
  3. searching for the new AssetTypes returns any results: `GET ref/v1/instruments?AssetTypes=Etf,Etc,Etn,Fund,Rights,CfdOnEtf,CfdOnEtc,CfdOnEtn,CfdOnFund,CfdOnRights,SrdOnEtf` (make sure to use an access token belonging to your live application, NOT the 24 hour token from the developer portal).
  4. looking up the example instruments from the above tables returns the AssetType value listed under "Extended AssetType Definition".


You WILL be impacted if any of the following is true:

  1. you know that you trade instruments of type ETF, ETN, ETC, Funds or Rights, but they have the AssetType "Stock" on OpenAPI.
  2. looking up the example instruments from the above tables returns the AssetType value listed under "Current AssetType Definition".


Taking Advantage of the new AssetType definition

The new asset type definition will be present across all OpenAPI endpoints.

Searching for Instruments

The biggest difference and benefit of switching to Extended AssetTypes will be noted when searching for instruments. Limiting a search to just "Stock" will lead to a smaller search result. To get the old behavior (that we don't expect you will want) your code will have to provide the full range of the new AssetTypes.

Searching according to the old configuration:

GET /openapi/ref/v1/instruments/?AssetTypes=Stock&Keywords=Invest


Similar search after the new configuration is applied:

GET /openapi/ref/v1/instruments/?AssetTypes=Stock,Etf,Etn,Etc,Fund,Rights&Keywords=Invest

Effect on other OpenAPI Endpoints

Other OpenAPI endpoints will also follow the new definition, so:

  • Of course the list of instruments from the search to /ref/instruments above will also return AssetType="Etf" or "Etf" or "Etn" rather than just "Stock" when applicable.
  • The AssetTypes of open orders, open and closed positions in the Portfolio service group will do the same.
  • And the same will apply across all other service groups, Account History,  AutoTrading, Client Services,  Chart, ... Trading etc. etc.

Migrating Your Application to Extended AssetTypes

You can try out Extended AssetTypes with your app before it's permanently enabled by adding a Pragma header to the request with the value "oapi-x-extasset" (i.e. 'Pragma: "oapi-x-extasset"'). This header has the same effect as the app setting for Extended AssetTypes, so you can test the behavior with your app.

See the example on Extended AssetTypes for a demo.

Once - after thorough testing - you are ready to switch your application to the Extended AssetType definition, then:

  • If you are a partner and Saxo has configured your application, please reach out to us to request a configuration change.
  • If you are an individual developer, please use the self service capability of the developer portal to create a new application.


All Simulation (SIM) applications will automatically be switched to Extended AssetTypes from October 2023.