This document describes how the asynchronous mode can be used to price financial contracts.
The asynchronous mode is provided by QPS Valuation service for requests that may contain several thousands of instruments and/or could take a long time to be executed.
The asynchronous mode supports the same instruments as the request/response API.
Input and output data models are the same as for the synchronous workflow.
An asynchronous request includes a financial contract definition as described in the IPA Financial Contracts documentation.
API endpoint for asynchronous requests of financial contarcts: https://api.refinitiv.com/data/quantitative-analytics/v1/async-financial-contracts.
As you can see from the example below, the asynchronous request is composed in the same way as all financial contracts requests.
But while the request in a synchronous mode is limited to 500 instruments, the maximum number of instruments in one request for an asynchronous mode is 50 000.
{
"fields": [
"InstrumentCode",
"BondType",
"IssueDate",
"EndDate",
"CouponRatePercent",
"Accrued",
"CleanPrice",
"DirtyPrice",
"YieldPercent",
"RedemptionDate",
"ModifiedDuration",
"Duration",
"DV01Bp",
"AverageLife",
"Convexity"
],
"outputs": [
"Headers",
"Data"
],
"universe": [
{
"instrumentType": "Bond",
"instrumentDefinition": {
"instrumentTag": "TreasuryBond_10Y",
"instrumentCode": "US10YT=RR"
}
}
]
}
Once an asynchronous request is accepted (Status:202), you will get an empty response with an operation ID (x-tr-requestid) in the header as shown in the table below.
Header Name | Header Status |
content-length | 0 |
content-type | |
location | /data/quantitative-analytics/v1/async-operation/fc816b19-2280-43e6-93da-725c61e53009 |
x-tr-requestid | fc816b19-2280-43e6-93da-725c61e53009 |
You can retrieve the status of the operation using that ID, e.g., to see whether it has been completed.
API endpoint to return (GET) status of an asynchronous operation: https://api.refinitiv.com/data/quantitative-analytics/v1/async-operation/{operationID}.
Please put the operation ID (fc816b19-2280-43e6-93da-725c61e53009) that was returned in the response on the previous stage into the endpoint path instead of the {operationID}.
Once the request is accepted (Status:202), you will get a response with the "status": "succeeded" in the raw as shown below.
{
"createdDateTime": "2024-03-05 08:04:35.702+0000",
"status": "succeeded",
"resourceLocation": "/data/quantitative-analytics/v1/async-resource/fc816b19-2280-43e6-93da-725c61e53009"
}
The are following operation statuses are possible:
You can get the result of financial contracts pricing using the same operation ID.
API endpoint to return (GET) asynchronous calculation result: https://api.refinitiv.com/data/quantitative-analytics/v1/async-resource/{operationID}.
Please put the operation ID (fc816b19-2280-43e6-93da-725c61e53009) into the endpoint path instead of the {operationID}.
Once the request is accepted (Status:202), you will get the calculation result.
{
"headers": [
{
"type": "String",
"name": "InstrumentCode"
},
{
"type": "String",
"name": "BondType"
},
{
"type": "Date",
"name": "IssueDate"
},
{
"type": "DateTime",
"name": "EndDate"
},
{
"type": "Float",
"name": "CouponRatePercent"
},
{
"type": "Float",
"name": "Accrued"
},
{
"type": "Float",
"name": "CleanPrice"
},
{
"type": "Float",
"name": "DirtyPrice"
},
{
"type": "Float",
"name": "YieldPercent"
},
{
"type": "Date",
"name": "RedemptionDate"
},
{
"type": "Float",
"name": "ModifiedDuration"
},
{
"type": "Float",
"name": "Duration"
},
{
"type": "Float",
"name": "DV01Bp"
},
{
"type": "Float",
"name": "AverageLife"
},
{
"type": "Float",
"name": "Convexity"
}
],
"data": [
[
"US10YT=RR",
"FixedRateBond",
"2024-02-15",
"2034-02-15T00:00:00Z",
4,
0.21978021978022,
98.5234375,
98.7432177197802,
4.18276242075309,
"2034-02-15",
8.09983293143305,
8.26923131543293,
7.99803599800364,
9.94505494505495,
77.6706347379562
]
]
}