curl --request POST \
--url https://api.riskportal.activeviam.com/api/Tradable/CalculateRiskForContracts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json-patch+json' \
--data '
{
"$type": "Derivitec.Web.Core.RiskEngine.ApiCalculateRiskForContractsRequest, Derivitec.Web.Core",
"provider_id": "<string>",
"market_data_environment_names": [
"<string>"
],
"market_data_environment_name": "Example market data",
"risk_measures": [
{
"$type": "Derivitec.Web.Core.RiskEngine.BorrowCurveDelta, Derivitec.Web.Core",
"tenors": [
"<string>"
],
"shock_size": 123,
"use_proportional_shocks": true,
"use_forward_rate_bumps": true,
"use_contract_currency": true
}
],
"risk_scenarios": [
{
"$type": "Derivitec.Web.Core.RiskEngine.RiskScenario, Derivitec.Web.Core",
"scenario_description": "<string>",
"scenario_name": "<string>"
}
],
"pricing_date": "2023-11-07T05:31:56Z",
"market_date": "2023-11-07T05:31:56Z",
"reporting_currency": "<string>",
"exclude_historically_derived_vol_surfaces": false,
"use_real_time_eq_spot": false,
"use_real_time_fx_spot": false,
"consolidate_error_messages": true,
"pricing_model_manager": {
"$type": "Derivitec.Web.Core.Tradables.IPricingModelManager, Derivitec.Web.Core"
},
"equity_indices_to_decompose": [
{
"key": {
"$type": "Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core",
"code": "<string>",
"market_identification_code": "<string>"
},
"value": true
}
],
"pricing_environment_name": "<string>",
"pricing_environment_id": "<string>",
"contracts": [
{
"$type": "Derivitec.Web.Core.Tradables.Ascot, Derivitec.Web.Core",
"identifier": "<string>",
"currency": "<string>",
"expiration_date": "2023-11-07T05:31:56Z",
"asset_swap_spread": 123,
"bond_identifier": {
"$type": "Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core",
"code": "<string>",
"market_identification_code": "<string>"
},
"calendar_name": "<string>",
"coupon_rate": 123,
"end_to_end": true,
"notional": 123,
"payment_lag": 123,
"period_str": "<string>",
"rate_asset_name": "<string>",
"roll_date": "2023-11-07T05:31:56Z",
"start_date": "2023-11-07T05:31:56Z",
"initial_fx_rate": 123
}
],
"include_contract_data_in_response": true
}
'import requests
url = "https://api.riskportal.activeviam.com/api/Tradable/CalculateRiskForContracts"
payload = {
"$type": "Derivitec.Web.Core.RiskEngine.ApiCalculateRiskForContractsRequest, Derivitec.Web.Core",
"provider_id": "<string>",
"market_data_environment_names": ["<string>"],
"market_data_environment_name": "Example market data",
"risk_measures": [
{
"$type": "Derivitec.Web.Core.RiskEngine.BorrowCurveDelta, Derivitec.Web.Core",
"tenors": ["<string>"],
"shock_size": 123,
"use_proportional_shocks": True,
"use_forward_rate_bumps": True,
"use_contract_currency": True
}
],
"risk_scenarios": [
{
"$type": "Derivitec.Web.Core.RiskEngine.RiskScenario, Derivitec.Web.Core",
"scenario_description": "<string>",
"scenario_name": "<string>"
}
],
"pricing_date": "2023-11-07T05:31:56Z",
"market_date": "2023-11-07T05:31:56Z",
"reporting_currency": "<string>",
"exclude_historically_derived_vol_surfaces": False,
"use_real_time_eq_spot": False,
"use_real_time_fx_spot": False,
"consolidate_error_messages": True,
"pricing_model_manager": { "$type": "Derivitec.Web.Core.Tradables.IPricingModelManager, Derivitec.Web.Core" },
"equity_indices_to_decompose": [
{
"key": {
"$type": "Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core",
"code": "<string>",
"market_identification_code": "<string>"
},
"value": True
}
],
"pricing_environment_name": "<string>",
"pricing_environment_id": "<string>",
"contracts": [
{
"$type": "Derivitec.Web.Core.Tradables.Ascot, Derivitec.Web.Core",
"identifier": "<string>",
"currency": "<string>",
"expiration_date": "2023-11-07T05:31:56Z",
"asset_swap_spread": 123,
"bond_identifier": {
"$type": "Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core",
"code": "<string>",
"market_identification_code": "<string>"
},
"calendar_name": "<string>",
"coupon_rate": 123,
"end_to_end": True,
"notional": 123,
"payment_lag": 123,
"period_str": "<string>",
"rate_asset_name": "<string>",
"roll_date": "2023-11-07T05:31:56Z",
"start_date": "2023-11-07T05:31:56Z",
"initial_fx_rate": 123
}
],
"include_contract_data_in_response": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json-patch+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json-patch+json'},
body: JSON.stringify({
$type: 'Derivitec.Web.Core.RiskEngine.ApiCalculateRiskForContractsRequest, Derivitec.Web.Core',
provider_id: '<string>',
market_data_environment_names: ['<string>'],
market_data_environment_name: 'Example market data',
risk_measures: [
{
$type: 'Derivitec.Web.Core.RiskEngine.BorrowCurveDelta, Derivitec.Web.Core',
tenors: ['<string>'],
shock_size: 123,
use_proportional_shocks: true,
use_forward_rate_bumps: true,
use_contract_currency: true
}
],
risk_scenarios: [
{
$type: 'Derivitec.Web.Core.RiskEngine.RiskScenario, Derivitec.Web.Core',
scenario_description: '<string>',
scenario_name: '<string>'
}
],
pricing_date: '2023-11-07T05:31:56Z',
market_date: '2023-11-07T05:31:56Z',
reporting_currency: '<string>',
exclude_historically_derived_vol_surfaces: false,
use_real_time_eq_spot: false,
use_real_time_fx_spot: false,
consolidate_error_messages: true,
pricing_model_manager: {$type: 'Derivitec.Web.Core.Tradables.IPricingModelManager, Derivitec.Web.Core'},
equity_indices_to_decompose: [
{
key: {
$type: 'Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core',
code: '<string>',
market_identification_code: '<string>'
},
value: true
}
],
pricing_environment_name: '<string>',
pricing_environment_id: '<string>',
contracts: [
{
$type: 'Derivitec.Web.Core.Tradables.Ascot, Derivitec.Web.Core',
identifier: '<string>',
currency: '<string>',
expiration_date: '2023-11-07T05:31:56Z',
asset_swap_spread: 123,
bond_identifier: {
$type: 'Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core',
code: '<string>',
market_identification_code: '<string>'
},
calendar_name: '<string>',
coupon_rate: 123,
end_to_end: true,
notional: 123,
payment_lag: 123,
period_str: '<string>',
rate_asset_name: '<string>',
roll_date: '2023-11-07T05:31:56Z',
start_date: '2023-11-07T05:31:56Z',
initial_fx_rate: 123
}
],
include_contract_data_in_response: true
})
};
fetch('https://api.riskportal.activeviam.com/api/Tradable/CalculateRiskForContracts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.riskportal.activeviam.com/api/Tradable/CalculateRiskForContracts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'$type' => 'Derivitec.Web.Core.RiskEngine.ApiCalculateRiskForContractsRequest, Derivitec.Web.Core',
'provider_id' => '<string>',
'market_data_environment_names' => [
'<string>'
],
'market_data_environment_name' => 'Example market data',
'risk_measures' => [
[
'$type' => 'Derivitec.Web.Core.RiskEngine.BorrowCurveDelta, Derivitec.Web.Core',
'tenors' => [
'<string>'
],
'shock_size' => 123,
'use_proportional_shocks' => true,
'use_forward_rate_bumps' => true,
'use_contract_currency' => true
]
],
'risk_scenarios' => [
[
'$type' => 'Derivitec.Web.Core.RiskEngine.RiskScenario, Derivitec.Web.Core',
'scenario_description' => '<string>',
'scenario_name' => '<string>'
]
],
'pricing_date' => '2023-11-07T05:31:56Z',
'market_date' => '2023-11-07T05:31:56Z',
'reporting_currency' => '<string>',
'exclude_historically_derived_vol_surfaces' => false,
'use_real_time_eq_spot' => false,
'use_real_time_fx_spot' => false,
'consolidate_error_messages' => true,
'pricing_model_manager' => [
'$type' => 'Derivitec.Web.Core.Tradables.IPricingModelManager, Derivitec.Web.Core'
],
'equity_indices_to_decompose' => [
[
'key' => [
'$type' => 'Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core',
'code' => '<string>',
'market_identification_code' => '<string>'
],
'value' => true
]
],
'pricing_environment_name' => '<string>',
'pricing_environment_id' => '<string>',
'contracts' => [
[
'$type' => 'Derivitec.Web.Core.Tradables.Ascot, Derivitec.Web.Core',
'identifier' => '<string>',
'currency' => '<string>',
'expiration_date' => '2023-11-07T05:31:56Z',
'asset_swap_spread' => 123,
'bond_identifier' => [
'$type' => 'Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core',
'code' => '<string>',
'market_identification_code' => '<string>'
],
'calendar_name' => '<string>',
'coupon_rate' => 123,
'end_to_end' => true,
'notional' => 123,
'payment_lag' => 123,
'period_str' => '<string>',
'rate_asset_name' => '<string>',
'roll_date' => '2023-11-07T05:31:56Z',
'start_date' => '2023-11-07T05:31:56Z',
'initial_fx_rate' => 123
]
],
'include_contract_data_in_response' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json-patch+json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.riskportal.activeviam.com/api/Tradable/CalculateRiskForContracts"
payload := strings.NewReader("{\n \"$type\": \"Derivitec.Web.Core.RiskEngine.ApiCalculateRiskForContractsRequest, Derivitec.Web.Core\",\n \"provider_id\": \"<string>\",\n \"market_data_environment_names\": [\n \"<string>\"\n ],\n \"market_data_environment_name\": \"Example market data\",\n \"risk_measures\": [\n {\n \"$type\": \"Derivitec.Web.Core.RiskEngine.BorrowCurveDelta, Derivitec.Web.Core\",\n \"tenors\": [\n \"<string>\"\n ],\n \"shock_size\": 123,\n \"use_proportional_shocks\": true,\n \"use_forward_rate_bumps\": true,\n \"use_contract_currency\": true\n }\n ],\n \"risk_scenarios\": [\n {\n \"$type\": \"Derivitec.Web.Core.RiskEngine.RiskScenario, Derivitec.Web.Core\",\n \"scenario_description\": \"<string>\",\n \"scenario_name\": \"<string>\"\n }\n ],\n \"pricing_date\": \"2023-11-07T05:31:56Z\",\n \"market_date\": \"2023-11-07T05:31:56Z\",\n \"reporting_currency\": \"<string>\",\n \"exclude_historically_derived_vol_surfaces\": false,\n \"use_real_time_eq_spot\": false,\n \"use_real_time_fx_spot\": false,\n \"consolidate_error_messages\": true,\n \"pricing_model_manager\": {\n \"$type\": \"Derivitec.Web.Core.Tradables.IPricingModelManager, Derivitec.Web.Core\"\n },\n \"equity_indices_to_decompose\": [\n {\n \"key\": {\n \"$type\": \"Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core\",\n \"code\": \"<string>\",\n \"market_identification_code\": \"<string>\"\n },\n \"value\": true\n }\n ],\n \"pricing_environment_name\": \"<string>\",\n \"pricing_environment_id\": \"<string>\",\n \"contracts\": [\n {\n \"$type\": \"Derivitec.Web.Core.Tradables.Ascot, Derivitec.Web.Core\",\n \"identifier\": \"<string>\",\n \"currency\": \"<string>\",\n \"expiration_date\": \"2023-11-07T05:31:56Z\",\n \"asset_swap_spread\": 123,\n \"bond_identifier\": {\n \"$type\": \"Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core\",\n \"code\": \"<string>\",\n \"market_identification_code\": \"<string>\"\n },\n \"calendar_name\": \"<string>\",\n \"coupon_rate\": 123,\n \"end_to_end\": true,\n \"notional\": 123,\n \"payment_lag\": 123,\n \"period_str\": \"<string>\",\n \"rate_asset_name\": \"<string>\",\n \"roll_date\": \"2023-11-07T05:31:56Z\",\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"initial_fx_rate\": 123\n }\n ],\n \"include_contract_data_in_response\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json-patch+json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.riskportal.activeviam.com/api/Tradable/CalculateRiskForContracts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"$type\": \"Derivitec.Web.Core.RiskEngine.ApiCalculateRiskForContractsRequest, Derivitec.Web.Core\",\n \"provider_id\": \"<string>\",\n \"market_data_environment_names\": [\n \"<string>\"\n ],\n \"market_data_environment_name\": \"Example market data\",\n \"risk_measures\": [\n {\n \"$type\": \"Derivitec.Web.Core.RiskEngine.BorrowCurveDelta, Derivitec.Web.Core\",\n \"tenors\": [\n \"<string>\"\n ],\n \"shock_size\": 123,\n \"use_proportional_shocks\": true,\n \"use_forward_rate_bumps\": true,\n \"use_contract_currency\": true\n }\n ],\n \"risk_scenarios\": [\n {\n \"$type\": \"Derivitec.Web.Core.RiskEngine.RiskScenario, Derivitec.Web.Core\",\n \"scenario_description\": \"<string>\",\n \"scenario_name\": \"<string>\"\n }\n ],\n \"pricing_date\": \"2023-11-07T05:31:56Z\",\n \"market_date\": \"2023-11-07T05:31:56Z\",\n \"reporting_currency\": \"<string>\",\n \"exclude_historically_derived_vol_surfaces\": false,\n \"use_real_time_eq_spot\": false,\n \"use_real_time_fx_spot\": false,\n \"consolidate_error_messages\": true,\n \"pricing_model_manager\": {\n \"$type\": \"Derivitec.Web.Core.Tradables.IPricingModelManager, Derivitec.Web.Core\"\n },\n \"equity_indices_to_decompose\": [\n {\n \"key\": {\n \"$type\": \"Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core\",\n \"code\": \"<string>\",\n \"market_identification_code\": \"<string>\"\n },\n \"value\": true\n }\n ],\n \"pricing_environment_name\": \"<string>\",\n \"pricing_environment_id\": \"<string>\",\n \"contracts\": [\n {\n \"$type\": \"Derivitec.Web.Core.Tradables.Ascot, Derivitec.Web.Core\",\n \"identifier\": \"<string>\",\n \"currency\": \"<string>\",\n \"expiration_date\": \"2023-11-07T05:31:56Z\",\n \"asset_swap_spread\": 123,\n \"bond_identifier\": {\n \"$type\": \"Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core\",\n \"code\": \"<string>\",\n \"market_identification_code\": \"<string>\"\n },\n \"calendar_name\": \"<string>\",\n \"coupon_rate\": 123,\n \"end_to_end\": true,\n \"notional\": 123,\n \"payment_lag\": 123,\n \"period_str\": \"<string>\",\n \"rate_asset_name\": \"<string>\",\n \"roll_date\": \"2023-11-07T05:31:56Z\",\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"initial_fx_rate\": 123\n }\n ],\n \"include_contract_data_in_response\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.riskportal.activeviam.com/api/Tradable/CalculateRiskForContracts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json-patch+json'
request.body = "{\n \"$type\": \"Derivitec.Web.Core.RiskEngine.ApiCalculateRiskForContractsRequest, Derivitec.Web.Core\",\n \"provider_id\": \"<string>\",\n \"market_data_environment_names\": [\n \"<string>\"\n ],\n \"market_data_environment_name\": \"Example market data\",\n \"risk_measures\": [\n {\n \"$type\": \"Derivitec.Web.Core.RiskEngine.BorrowCurveDelta, Derivitec.Web.Core\",\n \"tenors\": [\n \"<string>\"\n ],\n \"shock_size\": 123,\n \"use_proportional_shocks\": true,\n \"use_forward_rate_bumps\": true,\n \"use_contract_currency\": true\n }\n ],\n \"risk_scenarios\": [\n {\n \"$type\": \"Derivitec.Web.Core.RiskEngine.RiskScenario, Derivitec.Web.Core\",\n \"scenario_description\": \"<string>\",\n \"scenario_name\": \"<string>\"\n }\n ],\n \"pricing_date\": \"2023-11-07T05:31:56Z\",\n \"market_date\": \"2023-11-07T05:31:56Z\",\n \"reporting_currency\": \"<string>\",\n \"exclude_historically_derived_vol_surfaces\": false,\n \"use_real_time_eq_spot\": false,\n \"use_real_time_fx_spot\": false,\n \"consolidate_error_messages\": true,\n \"pricing_model_manager\": {\n \"$type\": \"Derivitec.Web.Core.Tradables.IPricingModelManager, Derivitec.Web.Core\"\n },\n \"equity_indices_to_decompose\": [\n {\n \"key\": {\n \"$type\": \"Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core\",\n \"code\": \"<string>\",\n \"market_identification_code\": \"<string>\"\n },\n \"value\": true\n }\n ],\n \"pricing_environment_name\": \"<string>\",\n \"pricing_environment_id\": \"<string>\",\n \"contracts\": [\n {\n \"$type\": \"Derivitec.Web.Core.Tradables.Ascot, Derivitec.Web.Core\",\n \"identifier\": \"<string>\",\n \"currency\": \"<string>\",\n \"expiration_date\": \"2023-11-07T05:31:56Z\",\n \"asset_swap_spread\": 123,\n \"bond_identifier\": {\n \"$type\": \"Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core\",\n \"code\": \"<string>\",\n \"market_identification_code\": \"<string>\"\n },\n \"calendar_name\": \"<string>\",\n \"coupon_rate\": 123,\n \"end_to_end\": true,\n \"notional\": 123,\n \"payment_lag\": 123,\n \"period_str\": \"<string>\",\n \"rate_asset_name\": \"<string>\",\n \"roll_date\": \"2023-11-07T05:31:56Z\",\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"initial_fx_rate\": 123\n }\n ],\n \"include_contract_data_in_response\": true\n}"
response = http.request(request)
puts response.read_body{
"$type": "Derivitec.Web.Core.RiskEngine.ApiCalculateRiskResponse, Derivitec.Web.Core",
"is_success": true,
"error_messages": [
"<string>"
],
"result": {
"$type": "Derivitec.Web.Core.RiskEngine.RiskCalculationResult, Derivitec.Web.Core",
"error_message": "<string>",
"error_messages": [
"<string>"
],
"error_messages_by_security_id": {},
"market_data_error_summary": {
"$type": "Derivitec.Web.Core.MarketData.MarketDataErrorSummary, Derivitec.Web.Core",
"bond_vol_surface_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.BondVolSurfaceError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"futures_market_id": "<string>",
"bond_short_name": "<string>"
}
],
"bond_yield_curve_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.BondYieldCurveError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"currency": "<string>",
"issuer_id": "<string>",
"debt_type": "<string>",
"issuer_name": "<string>"
}
],
"bond_yield_curve_spread_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.BondYieldCurveSpreadError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"bond_id": "<string>",
"isin": "<string>"
}
],
"credit_event_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.CreditEventError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"bond_id": "<string>",
"default_date": "<string>"
}
],
"calendar_errors": [
"<string>"
],
"cmdty_vol_surface_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.CmdtyVolSurfaceError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"commodity_id": "<string>",
"commodity_name": "<string>"
}
],
"commodity_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.CommodityError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"commodity_id": "<string>",
"commodity_name": "<string>"
}
],
"credit_index_correlation_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.CreditIndexCorrelationError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"index_id": "<string>",
"index_name": "<string>"
}
],
"credit_swaption_vol_cube_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.CreditSwaptionVolCubeError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"credit_id": "<string>",
"name": "<string>"
}
],
"discount_curve_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.DiscountCurveError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"currency": "<string>"
}
],
"equity_asset_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.EquityAssetError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"asset_id": "<string>",
"asset_ric": "<string>",
"asset_x_ignite_code": "<string>",
"asset_edi_code": "<string>",
"notes": "<string>"
}
],
"equity_equity_correlation_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.EquityEquityCorrelationError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"asset1_id": "<string>",
"asset1_name": "<string>",
"asset2_id": "<string>",
"asset2_name": "<string>"
}
],
"equity_fx_correlation_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.EquityFxCorrelationError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"eq_asset_id": "<string>",
"eq_asset_name": "<string>",
"fx_cross_id": "<string>"
}
],
"eq_ir_correlation_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.EqIRCorrelationError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"equity_id": "<string>",
"equity_name": "<string>",
"fixing_instrument_id": "<string>"
}
],
"fx_fx_correlation_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.FxFxCorrelationError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"fx_cross1_id": "<string>",
"fx_cross1_name": "<string>",
"fx_cross2_id": "<string>",
"fx_cross2_name": "<string>"
}
],
"equity_vol_index_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.EquityVolIndexError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"eq_vol_index_id": "<string>",
"eq_vol_index_name": "<string>",
"eq_vol_index_ric": "<string>"
}
],
"equity_vol_index_vol_surface_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.EquityVolIndexVolSurfaceError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"eq_vol_index_id": "<string>",
"eq_vol_index_ric": "<string>"
}
],
"equity_vol_surface_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.EquityVolSurfaceError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"asset_id": "<string>",
"asset_ric": "<string>"
}
],
"equity_vol_of_var_curve_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.EquityVolOfVarCurveError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"eq_vol_of_var_index_id": "<string>",
"eq_vol_of_var_index_ric": "<string>"
}
],
"dividend_index_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.DividendIndexError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"dividend_index_id": "<string>",
"dividend_index_name": "<string>",
"dividend_index_ric": "<string>"
}
],
"dividend_index_vol_surface_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.DividendIndexVolSurfaceError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"dividend_index_id": "<string>",
"dividend_index_ric": "<string>",
"futures_expiry_code": "<string>"
}
],
"fx_vol_of_var_curve_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.FxVolOfVarCurveError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"fx_vol_of_var_index_id": "<string>",
"fx_vol_of_var_index_ric": "<string>"
}
],
"fx_cross_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.FxCrossError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"fx_cross_id": "<string>"
}
],
"fx_vol_surface_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.FxVolSurfaceError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"fx_cross_id": "<string>"
}
],
"andersen_buffum_parameters_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.AndersenBuffumParametersError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"equity_id": "<string>"
}
],
"ir_futures_vol_cube_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.IrFuturesVolCubeError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"futures_market_id": "<string>",
"name": "<string>"
}
],
"rate_asset_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.RateAssetError, Derivitec.Web.Core",
"message": "<string>",
"rate_asset_id": "<string>",
"reference_date": "<string>"
}
],
"recovery_rate_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.RecoveryRateError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"bond_id": "<string>",
"issuer_id": "<string>",
"issuer_name": "<string>",
"debt_type": "<string>"
}
],
"probability_of_default_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.ProbabilityOfDefaultError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"asset_id": "<string>"
}
],
"amortisation_rate_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.AmortisationRateError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"asset_id": "<string>"
}
],
"survival_curve_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.SurvivalCurveError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"currency": "<string>",
"debt_type": "<string>",
"default_type": "<string>",
"issuer_id": "<string>",
"issuer_name": "<string>"
}
],
"swaption_vol_cube_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.SwaptionVolCubeError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"rate_asset_id": "<string>"
}
]
},
"risk_results": [
{
"$type": "Derivitec.Web.Core.RiskEngine.RiskResult, Derivitec.Web.Core",
"bond_issuer": {
"$type": "Derivitec.Web.Core.MarketData.IssuerIdentifier, Derivitec.Web.Core",
"code": "<string>",
"identifier_type": "DerivitecBondIssuerId"
},
"commodity_id": {
"$type": "Derivitec.Web.Core.MarketData.CommodityId, Derivitec.Web.Core",
"name": "<string>",
"exchange": "<string>"
},
"contract": {
"$type": "Derivitec.Web.Core.Tradables.Ascot, Derivitec.Web.Core",
"identifier": "<string>",
"currency": "<string>",
"expiration_date": "2023-11-07T05:31:56Z",
"asset_swap_spread": 123,
"bond_identifier": {
"$type": "Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core",
"code": "<string>",
"identifier_type": "Derivitec",
"market_identification_code": "<string>"
},
"business_day_convention": "actual",
"calendar_name": "<string>",
"coupon_rate": 123,
"day_count_convention": "actual_actual_icma",
"end_stub": "none",
"end_to_end": true,
"notional": 123,
"payment_lag": 123,
"period_str": "<string>",
"rate_asset_name": "<string>",
"roll_date": "2023-11-07T05:31:56Z",
"start_date": "2023-11-07T05:31:56Z",
"start_stub": "none",
"initial_fx_rate": 123
},
"currency": "<string>",
"curve_name": "<string>",
"equity_asset": {
"$type": "Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core",
"code": "<string>",
"identifier_type": "Derivitec",
"market_identification_code": "<string>"
},
"error_message": "<string>",
"fx_pair": "<string>",
"measure_id": "<string>",
"rate_asset_id": "<string>",
"scenario_key": "<string>",
"tenor": "<string>",
"tenor_name": "<string>",
"tradable_id": "<string>",
"unit_value": "<string>",
"unit_value_currency": "<string>",
"unit_value_is_valid": true
}
]
}
}Calculate requested risk measures for contracts.
Calculates requested measures and scenarios for contract definitions using the supplied dates, reporting currency, selected environments, and optional overrides. IncludeContractDataInResponse and ConsolidateErrorMessages default to true. With consolidation disabled, global errors invalidate the result while contract-specific failures appear as invalid measure or scenario rows. This synchronous, read-only operation has a configurable RiskCalculationRequest:Timeout deadline: 165 seconds by default and at most 170 seconds. If the deadline expires, HTTP 200 contains IsSuccess = false and the error “Risk calculation exceeded the application deadline. Reduce the request size and retry.”
curl --request POST \
--url https://api.riskportal.activeviam.com/api/Tradable/CalculateRiskForContracts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json-patch+json' \
--data '
{
"$type": "Derivitec.Web.Core.RiskEngine.ApiCalculateRiskForContractsRequest, Derivitec.Web.Core",
"provider_id": "<string>",
"market_data_environment_names": [
"<string>"
],
"market_data_environment_name": "Example market data",
"risk_measures": [
{
"$type": "Derivitec.Web.Core.RiskEngine.BorrowCurveDelta, Derivitec.Web.Core",
"tenors": [
"<string>"
],
"shock_size": 123,
"use_proportional_shocks": true,
"use_forward_rate_bumps": true,
"use_contract_currency": true
}
],
"risk_scenarios": [
{
"$type": "Derivitec.Web.Core.RiskEngine.RiskScenario, Derivitec.Web.Core",
"scenario_description": "<string>",
"scenario_name": "<string>"
}
],
"pricing_date": "2023-11-07T05:31:56Z",
"market_date": "2023-11-07T05:31:56Z",
"reporting_currency": "<string>",
"exclude_historically_derived_vol_surfaces": false,
"use_real_time_eq_spot": false,
"use_real_time_fx_spot": false,
"consolidate_error_messages": true,
"pricing_model_manager": {
"$type": "Derivitec.Web.Core.Tradables.IPricingModelManager, Derivitec.Web.Core"
},
"equity_indices_to_decompose": [
{
"key": {
"$type": "Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core",
"code": "<string>",
"market_identification_code": "<string>"
},
"value": true
}
],
"pricing_environment_name": "<string>",
"pricing_environment_id": "<string>",
"contracts": [
{
"$type": "Derivitec.Web.Core.Tradables.Ascot, Derivitec.Web.Core",
"identifier": "<string>",
"currency": "<string>",
"expiration_date": "2023-11-07T05:31:56Z",
"asset_swap_spread": 123,
"bond_identifier": {
"$type": "Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core",
"code": "<string>",
"market_identification_code": "<string>"
},
"calendar_name": "<string>",
"coupon_rate": 123,
"end_to_end": true,
"notional": 123,
"payment_lag": 123,
"period_str": "<string>",
"rate_asset_name": "<string>",
"roll_date": "2023-11-07T05:31:56Z",
"start_date": "2023-11-07T05:31:56Z",
"initial_fx_rate": 123
}
],
"include_contract_data_in_response": true
}
'import requests
url = "https://api.riskportal.activeviam.com/api/Tradable/CalculateRiskForContracts"
payload = {
"$type": "Derivitec.Web.Core.RiskEngine.ApiCalculateRiskForContractsRequest, Derivitec.Web.Core",
"provider_id": "<string>",
"market_data_environment_names": ["<string>"],
"market_data_environment_name": "Example market data",
"risk_measures": [
{
"$type": "Derivitec.Web.Core.RiskEngine.BorrowCurveDelta, Derivitec.Web.Core",
"tenors": ["<string>"],
"shock_size": 123,
"use_proportional_shocks": True,
"use_forward_rate_bumps": True,
"use_contract_currency": True
}
],
"risk_scenarios": [
{
"$type": "Derivitec.Web.Core.RiskEngine.RiskScenario, Derivitec.Web.Core",
"scenario_description": "<string>",
"scenario_name": "<string>"
}
],
"pricing_date": "2023-11-07T05:31:56Z",
"market_date": "2023-11-07T05:31:56Z",
"reporting_currency": "<string>",
"exclude_historically_derived_vol_surfaces": False,
"use_real_time_eq_spot": False,
"use_real_time_fx_spot": False,
"consolidate_error_messages": True,
"pricing_model_manager": { "$type": "Derivitec.Web.Core.Tradables.IPricingModelManager, Derivitec.Web.Core" },
"equity_indices_to_decompose": [
{
"key": {
"$type": "Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core",
"code": "<string>",
"market_identification_code": "<string>"
},
"value": True
}
],
"pricing_environment_name": "<string>",
"pricing_environment_id": "<string>",
"contracts": [
{
"$type": "Derivitec.Web.Core.Tradables.Ascot, Derivitec.Web.Core",
"identifier": "<string>",
"currency": "<string>",
"expiration_date": "2023-11-07T05:31:56Z",
"asset_swap_spread": 123,
"bond_identifier": {
"$type": "Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core",
"code": "<string>",
"market_identification_code": "<string>"
},
"calendar_name": "<string>",
"coupon_rate": 123,
"end_to_end": True,
"notional": 123,
"payment_lag": 123,
"period_str": "<string>",
"rate_asset_name": "<string>",
"roll_date": "2023-11-07T05:31:56Z",
"start_date": "2023-11-07T05:31:56Z",
"initial_fx_rate": 123
}
],
"include_contract_data_in_response": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json-patch+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json-patch+json'},
body: JSON.stringify({
$type: 'Derivitec.Web.Core.RiskEngine.ApiCalculateRiskForContractsRequest, Derivitec.Web.Core',
provider_id: '<string>',
market_data_environment_names: ['<string>'],
market_data_environment_name: 'Example market data',
risk_measures: [
{
$type: 'Derivitec.Web.Core.RiskEngine.BorrowCurveDelta, Derivitec.Web.Core',
tenors: ['<string>'],
shock_size: 123,
use_proportional_shocks: true,
use_forward_rate_bumps: true,
use_contract_currency: true
}
],
risk_scenarios: [
{
$type: 'Derivitec.Web.Core.RiskEngine.RiskScenario, Derivitec.Web.Core',
scenario_description: '<string>',
scenario_name: '<string>'
}
],
pricing_date: '2023-11-07T05:31:56Z',
market_date: '2023-11-07T05:31:56Z',
reporting_currency: '<string>',
exclude_historically_derived_vol_surfaces: false,
use_real_time_eq_spot: false,
use_real_time_fx_spot: false,
consolidate_error_messages: true,
pricing_model_manager: {$type: 'Derivitec.Web.Core.Tradables.IPricingModelManager, Derivitec.Web.Core'},
equity_indices_to_decompose: [
{
key: {
$type: 'Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core',
code: '<string>',
market_identification_code: '<string>'
},
value: true
}
],
pricing_environment_name: '<string>',
pricing_environment_id: '<string>',
contracts: [
{
$type: 'Derivitec.Web.Core.Tradables.Ascot, Derivitec.Web.Core',
identifier: '<string>',
currency: '<string>',
expiration_date: '2023-11-07T05:31:56Z',
asset_swap_spread: 123,
bond_identifier: {
$type: 'Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core',
code: '<string>',
market_identification_code: '<string>'
},
calendar_name: '<string>',
coupon_rate: 123,
end_to_end: true,
notional: 123,
payment_lag: 123,
period_str: '<string>',
rate_asset_name: '<string>',
roll_date: '2023-11-07T05:31:56Z',
start_date: '2023-11-07T05:31:56Z',
initial_fx_rate: 123
}
],
include_contract_data_in_response: true
})
};
fetch('https://api.riskportal.activeviam.com/api/Tradable/CalculateRiskForContracts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.riskportal.activeviam.com/api/Tradable/CalculateRiskForContracts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'$type' => 'Derivitec.Web.Core.RiskEngine.ApiCalculateRiskForContractsRequest, Derivitec.Web.Core',
'provider_id' => '<string>',
'market_data_environment_names' => [
'<string>'
],
'market_data_environment_name' => 'Example market data',
'risk_measures' => [
[
'$type' => 'Derivitec.Web.Core.RiskEngine.BorrowCurveDelta, Derivitec.Web.Core',
'tenors' => [
'<string>'
],
'shock_size' => 123,
'use_proportional_shocks' => true,
'use_forward_rate_bumps' => true,
'use_contract_currency' => true
]
],
'risk_scenarios' => [
[
'$type' => 'Derivitec.Web.Core.RiskEngine.RiskScenario, Derivitec.Web.Core',
'scenario_description' => '<string>',
'scenario_name' => '<string>'
]
],
'pricing_date' => '2023-11-07T05:31:56Z',
'market_date' => '2023-11-07T05:31:56Z',
'reporting_currency' => '<string>',
'exclude_historically_derived_vol_surfaces' => false,
'use_real_time_eq_spot' => false,
'use_real_time_fx_spot' => false,
'consolidate_error_messages' => true,
'pricing_model_manager' => [
'$type' => 'Derivitec.Web.Core.Tradables.IPricingModelManager, Derivitec.Web.Core'
],
'equity_indices_to_decompose' => [
[
'key' => [
'$type' => 'Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core',
'code' => '<string>',
'market_identification_code' => '<string>'
],
'value' => true
]
],
'pricing_environment_name' => '<string>',
'pricing_environment_id' => '<string>',
'contracts' => [
[
'$type' => 'Derivitec.Web.Core.Tradables.Ascot, Derivitec.Web.Core',
'identifier' => '<string>',
'currency' => '<string>',
'expiration_date' => '2023-11-07T05:31:56Z',
'asset_swap_spread' => 123,
'bond_identifier' => [
'$type' => 'Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core',
'code' => '<string>',
'market_identification_code' => '<string>'
],
'calendar_name' => '<string>',
'coupon_rate' => 123,
'end_to_end' => true,
'notional' => 123,
'payment_lag' => 123,
'period_str' => '<string>',
'rate_asset_name' => '<string>',
'roll_date' => '2023-11-07T05:31:56Z',
'start_date' => '2023-11-07T05:31:56Z',
'initial_fx_rate' => 123
]
],
'include_contract_data_in_response' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json-patch+json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.riskportal.activeviam.com/api/Tradable/CalculateRiskForContracts"
payload := strings.NewReader("{\n \"$type\": \"Derivitec.Web.Core.RiskEngine.ApiCalculateRiskForContractsRequest, Derivitec.Web.Core\",\n \"provider_id\": \"<string>\",\n \"market_data_environment_names\": [\n \"<string>\"\n ],\n \"market_data_environment_name\": \"Example market data\",\n \"risk_measures\": [\n {\n \"$type\": \"Derivitec.Web.Core.RiskEngine.BorrowCurveDelta, Derivitec.Web.Core\",\n \"tenors\": [\n \"<string>\"\n ],\n \"shock_size\": 123,\n \"use_proportional_shocks\": true,\n \"use_forward_rate_bumps\": true,\n \"use_contract_currency\": true\n }\n ],\n \"risk_scenarios\": [\n {\n \"$type\": \"Derivitec.Web.Core.RiskEngine.RiskScenario, Derivitec.Web.Core\",\n \"scenario_description\": \"<string>\",\n \"scenario_name\": \"<string>\"\n }\n ],\n \"pricing_date\": \"2023-11-07T05:31:56Z\",\n \"market_date\": \"2023-11-07T05:31:56Z\",\n \"reporting_currency\": \"<string>\",\n \"exclude_historically_derived_vol_surfaces\": false,\n \"use_real_time_eq_spot\": false,\n \"use_real_time_fx_spot\": false,\n \"consolidate_error_messages\": true,\n \"pricing_model_manager\": {\n \"$type\": \"Derivitec.Web.Core.Tradables.IPricingModelManager, Derivitec.Web.Core\"\n },\n \"equity_indices_to_decompose\": [\n {\n \"key\": {\n \"$type\": \"Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core\",\n \"code\": \"<string>\",\n \"market_identification_code\": \"<string>\"\n },\n \"value\": true\n }\n ],\n \"pricing_environment_name\": \"<string>\",\n \"pricing_environment_id\": \"<string>\",\n \"contracts\": [\n {\n \"$type\": \"Derivitec.Web.Core.Tradables.Ascot, Derivitec.Web.Core\",\n \"identifier\": \"<string>\",\n \"currency\": \"<string>\",\n \"expiration_date\": \"2023-11-07T05:31:56Z\",\n \"asset_swap_spread\": 123,\n \"bond_identifier\": {\n \"$type\": \"Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core\",\n \"code\": \"<string>\",\n \"market_identification_code\": \"<string>\"\n },\n \"calendar_name\": \"<string>\",\n \"coupon_rate\": 123,\n \"end_to_end\": true,\n \"notional\": 123,\n \"payment_lag\": 123,\n \"period_str\": \"<string>\",\n \"rate_asset_name\": \"<string>\",\n \"roll_date\": \"2023-11-07T05:31:56Z\",\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"initial_fx_rate\": 123\n }\n ],\n \"include_contract_data_in_response\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json-patch+json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.riskportal.activeviam.com/api/Tradable/CalculateRiskForContracts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"$type\": \"Derivitec.Web.Core.RiskEngine.ApiCalculateRiskForContractsRequest, Derivitec.Web.Core\",\n \"provider_id\": \"<string>\",\n \"market_data_environment_names\": [\n \"<string>\"\n ],\n \"market_data_environment_name\": \"Example market data\",\n \"risk_measures\": [\n {\n \"$type\": \"Derivitec.Web.Core.RiskEngine.BorrowCurveDelta, Derivitec.Web.Core\",\n \"tenors\": [\n \"<string>\"\n ],\n \"shock_size\": 123,\n \"use_proportional_shocks\": true,\n \"use_forward_rate_bumps\": true,\n \"use_contract_currency\": true\n }\n ],\n \"risk_scenarios\": [\n {\n \"$type\": \"Derivitec.Web.Core.RiskEngine.RiskScenario, Derivitec.Web.Core\",\n \"scenario_description\": \"<string>\",\n \"scenario_name\": \"<string>\"\n }\n ],\n \"pricing_date\": \"2023-11-07T05:31:56Z\",\n \"market_date\": \"2023-11-07T05:31:56Z\",\n \"reporting_currency\": \"<string>\",\n \"exclude_historically_derived_vol_surfaces\": false,\n \"use_real_time_eq_spot\": false,\n \"use_real_time_fx_spot\": false,\n \"consolidate_error_messages\": true,\n \"pricing_model_manager\": {\n \"$type\": \"Derivitec.Web.Core.Tradables.IPricingModelManager, Derivitec.Web.Core\"\n },\n \"equity_indices_to_decompose\": [\n {\n \"key\": {\n \"$type\": \"Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core\",\n \"code\": \"<string>\",\n \"market_identification_code\": \"<string>\"\n },\n \"value\": true\n }\n ],\n \"pricing_environment_name\": \"<string>\",\n \"pricing_environment_id\": \"<string>\",\n \"contracts\": [\n {\n \"$type\": \"Derivitec.Web.Core.Tradables.Ascot, Derivitec.Web.Core\",\n \"identifier\": \"<string>\",\n \"currency\": \"<string>\",\n \"expiration_date\": \"2023-11-07T05:31:56Z\",\n \"asset_swap_spread\": 123,\n \"bond_identifier\": {\n \"$type\": \"Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core\",\n \"code\": \"<string>\",\n \"market_identification_code\": \"<string>\"\n },\n \"calendar_name\": \"<string>\",\n \"coupon_rate\": 123,\n \"end_to_end\": true,\n \"notional\": 123,\n \"payment_lag\": 123,\n \"period_str\": \"<string>\",\n \"rate_asset_name\": \"<string>\",\n \"roll_date\": \"2023-11-07T05:31:56Z\",\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"initial_fx_rate\": 123\n }\n ],\n \"include_contract_data_in_response\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.riskportal.activeviam.com/api/Tradable/CalculateRiskForContracts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json-patch+json'
request.body = "{\n \"$type\": \"Derivitec.Web.Core.RiskEngine.ApiCalculateRiskForContractsRequest, Derivitec.Web.Core\",\n \"provider_id\": \"<string>\",\n \"market_data_environment_names\": [\n \"<string>\"\n ],\n \"market_data_environment_name\": \"Example market data\",\n \"risk_measures\": [\n {\n \"$type\": \"Derivitec.Web.Core.RiskEngine.BorrowCurveDelta, Derivitec.Web.Core\",\n \"tenors\": [\n \"<string>\"\n ],\n \"shock_size\": 123,\n \"use_proportional_shocks\": true,\n \"use_forward_rate_bumps\": true,\n \"use_contract_currency\": true\n }\n ],\n \"risk_scenarios\": [\n {\n \"$type\": \"Derivitec.Web.Core.RiskEngine.RiskScenario, Derivitec.Web.Core\",\n \"scenario_description\": \"<string>\",\n \"scenario_name\": \"<string>\"\n }\n ],\n \"pricing_date\": \"2023-11-07T05:31:56Z\",\n \"market_date\": \"2023-11-07T05:31:56Z\",\n \"reporting_currency\": \"<string>\",\n \"exclude_historically_derived_vol_surfaces\": false,\n \"use_real_time_eq_spot\": false,\n \"use_real_time_fx_spot\": false,\n \"consolidate_error_messages\": true,\n \"pricing_model_manager\": {\n \"$type\": \"Derivitec.Web.Core.Tradables.IPricingModelManager, Derivitec.Web.Core\"\n },\n \"equity_indices_to_decompose\": [\n {\n \"key\": {\n \"$type\": \"Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core\",\n \"code\": \"<string>\",\n \"market_identification_code\": \"<string>\"\n },\n \"value\": true\n }\n ],\n \"pricing_environment_name\": \"<string>\",\n \"pricing_environment_id\": \"<string>\",\n \"contracts\": [\n {\n \"$type\": \"Derivitec.Web.Core.Tradables.Ascot, Derivitec.Web.Core\",\n \"identifier\": \"<string>\",\n \"currency\": \"<string>\",\n \"expiration_date\": \"2023-11-07T05:31:56Z\",\n \"asset_swap_spread\": 123,\n \"bond_identifier\": {\n \"$type\": \"Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core\",\n \"code\": \"<string>\",\n \"market_identification_code\": \"<string>\"\n },\n \"calendar_name\": \"<string>\",\n \"coupon_rate\": 123,\n \"end_to_end\": true,\n \"notional\": 123,\n \"payment_lag\": 123,\n \"period_str\": \"<string>\",\n \"rate_asset_name\": \"<string>\",\n \"roll_date\": \"2023-11-07T05:31:56Z\",\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"initial_fx_rate\": 123\n }\n ],\n \"include_contract_data_in_response\": true\n}"
response = http.request(request)
puts response.read_body{
"$type": "Derivitec.Web.Core.RiskEngine.ApiCalculateRiskResponse, Derivitec.Web.Core",
"is_success": true,
"error_messages": [
"<string>"
],
"result": {
"$type": "Derivitec.Web.Core.RiskEngine.RiskCalculationResult, Derivitec.Web.Core",
"error_message": "<string>",
"error_messages": [
"<string>"
],
"error_messages_by_security_id": {},
"market_data_error_summary": {
"$type": "Derivitec.Web.Core.MarketData.MarketDataErrorSummary, Derivitec.Web.Core",
"bond_vol_surface_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.BondVolSurfaceError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"futures_market_id": "<string>",
"bond_short_name": "<string>"
}
],
"bond_yield_curve_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.BondYieldCurveError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"currency": "<string>",
"issuer_id": "<string>",
"debt_type": "<string>",
"issuer_name": "<string>"
}
],
"bond_yield_curve_spread_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.BondYieldCurveSpreadError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"bond_id": "<string>",
"isin": "<string>"
}
],
"credit_event_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.CreditEventError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"bond_id": "<string>",
"default_date": "<string>"
}
],
"calendar_errors": [
"<string>"
],
"cmdty_vol_surface_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.CmdtyVolSurfaceError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"commodity_id": "<string>",
"commodity_name": "<string>"
}
],
"commodity_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.CommodityError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"commodity_id": "<string>",
"commodity_name": "<string>"
}
],
"credit_index_correlation_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.CreditIndexCorrelationError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"index_id": "<string>",
"index_name": "<string>"
}
],
"credit_swaption_vol_cube_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.CreditSwaptionVolCubeError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"credit_id": "<string>",
"name": "<string>"
}
],
"discount_curve_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.DiscountCurveError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"currency": "<string>"
}
],
"equity_asset_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.EquityAssetError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"asset_id": "<string>",
"asset_ric": "<string>",
"asset_x_ignite_code": "<string>",
"asset_edi_code": "<string>",
"notes": "<string>"
}
],
"equity_equity_correlation_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.EquityEquityCorrelationError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"asset1_id": "<string>",
"asset1_name": "<string>",
"asset2_id": "<string>",
"asset2_name": "<string>"
}
],
"equity_fx_correlation_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.EquityFxCorrelationError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"eq_asset_id": "<string>",
"eq_asset_name": "<string>",
"fx_cross_id": "<string>"
}
],
"eq_ir_correlation_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.EqIRCorrelationError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"equity_id": "<string>",
"equity_name": "<string>",
"fixing_instrument_id": "<string>"
}
],
"fx_fx_correlation_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.FxFxCorrelationError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"fx_cross1_id": "<string>",
"fx_cross1_name": "<string>",
"fx_cross2_id": "<string>",
"fx_cross2_name": "<string>"
}
],
"equity_vol_index_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.EquityVolIndexError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"eq_vol_index_id": "<string>",
"eq_vol_index_name": "<string>",
"eq_vol_index_ric": "<string>"
}
],
"equity_vol_index_vol_surface_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.EquityVolIndexVolSurfaceError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"eq_vol_index_id": "<string>",
"eq_vol_index_ric": "<string>"
}
],
"equity_vol_surface_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.EquityVolSurfaceError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"asset_id": "<string>",
"asset_ric": "<string>"
}
],
"equity_vol_of_var_curve_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.EquityVolOfVarCurveError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"eq_vol_of_var_index_id": "<string>",
"eq_vol_of_var_index_ric": "<string>"
}
],
"dividend_index_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.DividendIndexError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"dividend_index_id": "<string>",
"dividend_index_name": "<string>",
"dividend_index_ric": "<string>"
}
],
"dividend_index_vol_surface_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.DividendIndexVolSurfaceError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"dividend_index_id": "<string>",
"dividend_index_ric": "<string>",
"futures_expiry_code": "<string>"
}
],
"fx_vol_of_var_curve_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.FxVolOfVarCurveError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"fx_vol_of_var_index_id": "<string>",
"fx_vol_of_var_index_ric": "<string>"
}
],
"fx_cross_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.FxCrossError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"fx_cross_id": "<string>"
}
],
"fx_vol_surface_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.FxVolSurfaceError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"fx_cross_id": "<string>"
}
],
"andersen_buffum_parameters_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.AndersenBuffumParametersError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"equity_id": "<string>"
}
],
"ir_futures_vol_cube_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.IrFuturesVolCubeError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"futures_market_id": "<string>",
"name": "<string>"
}
],
"rate_asset_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.RateAssetError, Derivitec.Web.Core",
"message": "<string>",
"rate_asset_id": "<string>",
"reference_date": "<string>"
}
],
"recovery_rate_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.RecoveryRateError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"bond_id": "<string>",
"issuer_id": "<string>",
"issuer_name": "<string>",
"debt_type": "<string>"
}
],
"probability_of_default_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.ProbabilityOfDefaultError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"asset_id": "<string>"
}
],
"amortisation_rate_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.AmortisationRateError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"asset_id": "<string>"
}
],
"survival_curve_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.SurvivalCurveError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"currency": "<string>",
"debt_type": "<string>",
"default_type": "<string>",
"issuer_id": "<string>",
"issuer_name": "<string>"
}
],
"swaption_vol_cube_errors": [
{
"$type": "Derivitec.Web.Core.MarketData.SwaptionVolCubeError, Derivitec.Web.Core",
"message": "<string>",
"reference_date": "<string>",
"rate_asset_id": "<string>"
}
]
},
"risk_results": [
{
"$type": "Derivitec.Web.Core.RiskEngine.RiskResult, Derivitec.Web.Core",
"bond_issuer": {
"$type": "Derivitec.Web.Core.MarketData.IssuerIdentifier, Derivitec.Web.Core",
"code": "<string>",
"identifier_type": "DerivitecBondIssuerId"
},
"commodity_id": {
"$type": "Derivitec.Web.Core.MarketData.CommodityId, Derivitec.Web.Core",
"name": "<string>",
"exchange": "<string>"
},
"contract": {
"$type": "Derivitec.Web.Core.Tradables.Ascot, Derivitec.Web.Core",
"identifier": "<string>",
"currency": "<string>",
"expiration_date": "2023-11-07T05:31:56Z",
"asset_swap_spread": 123,
"bond_identifier": {
"$type": "Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core",
"code": "<string>",
"identifier_type": "Derivitec",
"market_identification_code": "<string>"
},
"business_day_convention": "actual",
"calendar_name": "<string>",
"coupon_rate": 123,
"day_count_convention": "actual_actual_icma",
"end_stub": "none",
"end_to_end": true,
"notional": 123,
"payment_lag": 123,
"period_str": "<string>",
"rate_asset_name": "<string>",
"roll_date": "2023-11-07T05:31:56Z",
"start_date": "2023-11-07T05:31:56Z",
"start_stub": "none",
"initial_fx_rate": 123
},
"currency": "<string>",
"curve_name": "<string>",
"equity_asset": {
"$type": "Derivitec.Web.Core.MarketData.InstrumentIdentifier, Derivitec.Web.Core",
"code": "<string>",
"identifier_type": "Derivitec",
"market_identification_code": "<string>"
},
"error_message": "<string>",
"fx_pair": "<string>",
"measure_id": "<string>",
"rate_asset_id": "<string>",
"scenario_key": "<string>",
"tenor": "<string>",
"tenor_name": "<string>",
"tradable_id": "<string>",
"unit_value": "<string>",
"unit_value_currency": "<string>",
"unit_value_is_valid": true
}
]
}
}Authorizations
OAuth2 access-token requested from AWS Cognito and provided as a Auth Bearer header
Body
JSON request with non-empty Contracts, non-null RiskMeasures (an empty list is not explicitly rejected), meaningful PricingDate and MarketDate, reporting currency, optional scenarios, overrides, model choice, realtime flags, index decomposition, pricing-environment identifier, and one unambiguous market-data environment selection.
Requests risk measures for supplied contract definitions.
Derivitec.Web.Core.RiskEngine.ApiCalculateRiskForContractsRequest, Derivitec.Web.Core Opaque identifier of a single market-data provider to use instead of either environment-name option.
Access classification associated with the selected market-data environment.
view, edit, owner, blocked Names of the market-data environments to use. Do not combine this list with the single-name or provider-ID alternatives.
Single market-data environment name to use instead of market_data_environment_names or provider_id.
"Example market data"
Risk-measure definitions to evaluate for each requested tradable.
Common role for a named risk measure exposed through calculation and report contracts.
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
- Option 9
- Option 10
- Option 11
- Option 12
- Option 13
- Option 14
- Option 15
- Option 16
- Option 17
- Option 18
- Option 19
- Option 20
- Option 21
- Option 22
- Option 23
- Option 24
- Option 25
- Option 26
- Option 27
- Option 28
- Option 29
- Option 30
- Option 31
- Option 32
- Option 33
- Option 34
- Option 35
- Option 36
- Option 37
- Option 38
- Option 39
- Option 40
- Option 41
- Option 42
- Option 43
- Option 44
- Option 45
- Option 46
- Option 47
- Option 48
- Option 49
- Option 50
- Option 51
- Option 52
- Option 53
- Option 54
- Option 55
- Option 56
- Option 57
- Option 58
- Option 59
- Option 60
- Option 61
- Option 62
- Option 63
- Option 64
- Option 65
- Option 66
- Option 67
- Option 68
- Option 69
Show child attributes
Show child attributes
Additional scenarios under which the requested measures are evaluated; defaults to an empty list.
Names and describes a scenario supplied to a risk calculation.
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
- Option 9
- Option 10
- Option 11
- Option 12
- Option 13
- Option 14
- Option 15
- Option 16
- Option 17
- Option 18
- Option 19
- Option 20
- Option 21
- Option 22
- Option 23
Show child attributes
Show child attributes
Valuation date for the requested risk measures.
Date of the market data used by the calculation.
Optional market-data substitutions supplied with pricing, risk, or report calculations.
Show child attributes
Show child attributes
Currency in which currency-denominated risk results are reported.
Whether historically derived volatility surfaces are excluded from the selected market data; defaults to false.
false
Whether real-time equity spot inputs are requested; defaults to false.
false
Whether real-time foreign-exchange spot inputs are requested; defaults to false.
false
Whether repeated calculation errors are consolidated in the response; defaults to true.
true
Pricing-model configuration role accepted by calculation requests.
- Option 1
- Option 2
Show child attributes
Show child attributes
Equity-index identifiers paired with flags that control whether each index is decomposed for this calculation.
Show child attributes
Show child attributes
Optional accessible pricing-environment name; when supplied, it selects the environment in place of pricing_environment_id.
Optional identifier of the pricing environment; used when no name is supplied.
Contract definitions for which risk is calculated.
Polymorphic base role shared by public contract definitions.
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
- Option 9
- Option 10
- Option 11
- Option 12
- Option 13
- Option 14
- Option 15
- Option 16
- Option 17
- Option 18
- Option 19
- Option 20
- Option 21
- Option 22
- Option 23
- Option 24
- Option 25
- Option 26
- Option 27
- Option 28
- Option 29
- Option 30
- Option 31
- Option 32
- Option 33
- Option 34
- Option 35
- Option 36
- Option 37
- Option 38
- Option 39
- Option 40
- Option 41
- Option 42
- Option 43
- Option 44
- Option 45
- Option 46
- Option 47
- Option 48
- Option 49
- Option 50
- Option 51
- Option 52
- Option 53
- Option 54
- Option 55
- Option 56
- Option 57
- Option 58
- Option 59
- Option 60
- Option 61
- Option 62
- Option 63
- Option 64
- Option 65
- Option 66
- Option 67
- Option 68
- Option 69
- Option 70
- Option 71
- Option 72
- Option 73
- Option 74
- Option 75
- Option 76
- Option 77
- Option 78
- Option 79
- Option 80
- Option 81
- Option 82
- Option 83
- Option 84
- Option 85
- Option 86
- Option 87
- Option 88
- Option 89
- Option 90
- Option 91
- Option 92
- Option 93
- Option 94
- Option 95
- Option 96
- Option 97
- Option 98
- Option 99
- Option 100
- Option 101
- Option 102
- Option 103
- Option 104
- Option 105
- Option 106
- Option 107
- Option 108
- Option 109
- Option 110
Show child attributes
Show child attributes
Whether each returned risk row includes its contract definition; defaults to true.
true
Response
Returns risk results and global or contract-specific errors. Any error sets aggregate IsSuccess to false.
Returns risk results and calculation diagnostics.
Derivitec.Web.Core.RiskEngine.ApiCalculateRiskResponse, Derivitec.Web.Core Whether the operation completed successfully. The default is true; error outcomes set it to false.
true
Messages explaining operation-level failures. The collection is empty by default.
Collects risk rows and diagnostics for one risk-calculation request.
Show child attributes
Show child attributes
Was this page helpful?