Build, price and trade your bespoke structured products

The SG Markets SP API is a web service that allows Clients to price and trade a wide variation of the structured products available in SG Markets SP. The service is designed to assist users in requesting indicative prices for SG Markets SP products from 3rd party systems where they only need to specify a small number of parameters to receive a price.

Price and trade structured products

Pricing, trading and documentation are available for numerous predefined structured products.

check_circleQuote
check_circleTermsheet
check_circlePrice
check_circleTrade
check_circleStructured Products
check_circleAutocall
check_circleReverse Convertible
check_circleParticipation
check_circleCredit Linked Note

Authentication

Generate SG connect token

For connecting to the external API, you first need to get a SG Connect token that will authenticate you in the SG ecosystem. For that you must call SG Connect server with your secret and client id formatted correctly. You need to send your credentials separated by a “:” (ex: “secret:client_id”) and encoded as a base64 string. Then add the result in the headers, under the “Authorization” property preceded by “Basic” (see curl example).

You also need to specify the grant type and the scope. The scope will determine the rights that will be granted to you (example: read, write) and the grant type is the way your credential will flow in the SG ecosystem. For connecting to the external API, you must specify the grant type as ”client credentials” and the scope as “openid profile api.sgmarkets-execution-structured-products.v1”.

Please refer to SG Markets Apis / Authentication for further information.

	using (var client = new HttpClient()) { 
	// Format client and secret id
	var result = Convert.ToBase64String(Encoding.UTF8.GetBytes("client_id:secret_id"));
							
	//Define Headers
	client.DefaultRequestHeaders.Accept.Clear();
	client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
	client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", result);

	//Prepare Request Body
	var requestData = new List<KeyValuePair<string, string>> {
		new KeyValuePair<string, string>("grant_type", "client_credentials")
	};
	var requestBody = new FormUrlEncodedContent(requestData);

	//Request Token
	var request = await client.PostAsync("https://sso.sgmarkets.com/sgconnect/oauth2/access_token?grant_type=client_credentials&
										scope=openid profile api.sgmarkets-execution-structured-products.v1", requestBody);
	}
	import requests

	access_token_endpoint = "https://sso.sgmarkets.com/sgconnect/oauth2/access_token"

	lient_id = "..."
	client_secret = "..."
	scopes = ["openid", "profile", "api.sgmarkets-execution-structured-products.v1"]

	response = requests.post(access_token_endpoint,
	verify=False,
	auth=(client_id, client_secret),
	data={'grant_type': 'client_credentials', 'scope': ' '.join(scopes)})

	if response.ok:
	print(response.json()["access_token"])
	curl -Method POST -Headers @{"Accept"="application/json";" 
	Authorization"="Basic MhBhRzc1ZjAtNDlmMi0ON2FhLVhlODQtYmC2YmNlYWQxMzI5OjFkYWxpZXszYzRkaWo0aWg3ZTg3ZG04OTY2NThr"} 
	'https://sso.sgmarkets.com/sgconnect/oauth2/access_token? 
	grant_type=client_credentials&scope=openid profile api.sgmarkets-execution-structured-products.v1'

SG Connect token Refresh

You must refresh the SG Connect token after a certain period of time, the validity period of the token is given under the “expires_in” property of the response given by SG Connect server, this unit is expressed in seconds.

Primary market API end points

Basic rules for indicative quotes

When requesting for an indicative quote with regulation, meaning with Mifid2section, you have many use cases:

When requesting for an indicative quote without regulation, meaning without Mifid2 section the KID and the Target Market will not be generated even if they are configured as required in the system.

Basic rules for tradable quotes

When requesting for a tradable quote

To force the KID generation, you should add the additionalKidLanguages tag under the mifid2 section.

{
    [...],
    "mifid2": {
        "distributionCountries": [
          "France","UnitedKingdom"
        ],
        "additionalKidLanguages": [
          "German","Dutch"
        ]
      },
    [...]
}                                                

To force Target Market generation, you should add the tag ForceTargetMarket under the mifid2 section:

{
    [...],
    "mifid2": {
        [...],
        "forceTargetMarket": true
      },
    [...]               
} 

The values of available KID and Distribution Countries languages are available from the Schemas section from the swagger: API Swagger

DistributionCountry: string
    Enum
        [ Andorra, UnitedArabEmirates, Argentina, Austria, Belgium, Bahrain, Bahamas, Bermuda, Bolivia, Brazil, Switzerland, 
        Chile, Colombia, CostaRica, CaymanIslands, Germany, Ecuador, Spain, Finland, France, UnitedKingdom, Guernsey, 
        Guatemala, HongKong, Honduras, Ireland, Israel, Italy, Jersey, Luxembourg, Monaco, Mexico, Netherlands, 
        Panama, Peru, Portugal, RussianFederation, SaudiArabia, Singapore, ElSalvador, Sweden, Uruguay, BritishVirginIslands, 
        Dubai, SouthAfrica ]

KidLanguage: string
    Enum
        [ Finnish, Dutch, English, French, German, Italian, Portuguese, Spanish, Swedish ]

Trade workflow

FAQ

  • Add the below section to the JSON template to customize recallThreshold and recallCoupon for periods 2 and 3.
  • {
        [...],
        "scheduleCustomization": [
            {
            "periodId": 2,
            "recallThreshold": 99,
            "recallCoupon": 3
            },
            {
            "periodId": 4,
            "recallThreshold": 98,
            "recallCoupon": 7
            }
        ],
        [...]                                     
    }
    
  • As a result, the schedule will be customized as below:
  • Card image cap
  • Add these lines to the JSON template to:
  • Card image cap
  • As a result, the schedule will be customized as below:
  • Card image cap

When requesting for an indicative quote with regulation, meaning with Mifid2 section, you have many use cases:

  • If only the KID is mandatory:
  • KID document will be generated with the defaulted languages configured in the system and there is no need to explicitly add the AdditionalKidLanguages tag.

    Example:
    For a specific client, only KID is mandatory in the system and it is configured as required with these three languages by default: English, Italian and French. In the JSON template, you will only need to add the Mifid2 section as shown below: Card image cap

    As an output you will have the three KID documents generated with the three defaulted Languages English, Italian and French: Card image cap

  • If an additional KID language should be added, the tag AdditionalKidLanguages should be used
  • Example:

    For a specific client, only KID is mandatory in the system, and it is configured as required with these three languages by default: English, Italian and French.

    If an additional KID language needs to be added, let’s say German, use the below tag.

    Card image cap

    In the JSON template you will need to add the Mifid2 section as shown below:

    Card image cap

    As an output you will have 4 KID documents generated with four Languages English, Italian, French and German.

    Card image cap

If the Target Market document is needed and not configured as required in the system, we will need to force the generation, to do so the tag ForceTargetMarket must be added to the Mifid2 section as shown below:

Card image cap

As output you will have 4 KID documents generated with four Languages English, Italian, French and German plus the Target Market document:

Card image cap

For indicative and tradable quotes, call the route with the SGM IDGET /api/v1/quote/{quoteId} to get the quote details, the regulation documents are available in the the Mifid2 section.

Below an example of an output:
Card image cap

Mandatory fields for an indicative quote:

  1. ProductType
  2. ProductSubtype
  3. Wrapper
  4. Currency
  5. Underlying
  6. SolvingMode

Mandatory fields for a tradable quote:

  1. ProductType
  2. ProductSubtype
  3. Wrapper
  4. Currency
  5. Underlying
  6. DealSplit
  7. SolvingMode

post:/api/v1/tradable-quotes/*/execution: Writing capacity is 3 per minute

get:/api/v1/underlying-universe*: Reading capacity is 1 per minute

post:/api/v1/tradable-quotes*: Writing capacity is 3 per minute

post:/api/v1/custodians*: Reading capacity is 1 per minute

get:/api/v1/termsheet/*: Reading capacity is 6 per minute

get:/api/v1/quote/*: Reading capacity is 6 per minute

post:/api/v1/quotes*: Writing capacity is 3 per minute

get:/api/v1/trade/*: Reading capacity is 6 per minute

If the limit is reached, The request will be rejected and the HTTP error code 429 (Too many requests) will be returned

Use the route GET /api/v1/termsheet/{quoteId}/{language}, The response is a PDF file.

Entry data: The quote ID and the choosen language, today 2 options are available (English and French)

Result: Coded termsheet, it should be then converted from Base64 to PDF.

  1. Add the tag DealSplit to the JSON file as shown below.
  2. Card image cap

  3. The Your first custodian is the BDR returned when calling the route: POST /api/v1/custodians
  4. Please see the example below:

    Entry data: Card image cap

    Response: Card image cap

We support the Secondary Market via the API. The documentation is comming soon. You can find out the secondary API end point via the API Swagger

Example of JSON requests

Autocalls

Product Subtype Wrapper Solve for Json
Athena/Apollon Note Upfront fee Json Download
Athena/Apollon Note Strike Json Download
Athena/Apollon Note Recall coupon Json Download
Athena/Apollon Note Recall threshold Json Download
Athena/Apollon Note KI threshold Json Download