Preview a trade event's position effects.
curl --request POST \
--url https://api.riskportal.activeviam.com/api/Tradable/GetTradeEventPositionEffects \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json-patch+json' \
--data '
{
"$type": "Derivitec.Web.Core.Tradables.ApiGetTradeEventPositionEffectsRequest, Derivitec.Web.Core",
"tradable_id": "<string>",
"pricing_date": "2023-11-07T05:31:56Z",
"next_trade_event": {
"$type": "Derivitec.Web.Core.TradeEvents.BuyEvent, Derivitec.Web.Core",
"unit_price": 123
}
}
'import requests
url = "https://api.riskportal.activeviam.com/api/Tradable/GetTradeEventPositionEffects"
payload = {
"$type": "Derivitec.Web.Core.Tradables.ApiGetTradeEventPositionEffectsRequest, Derivitec.Web.Core",
"tradable_id": "<string>",
"pricing_date": "2023-11-07T05:31:56Z",
"next_trade_event": {
"$type": "Derivitec.Web.Core.TradeEvents.BuyEvent, Derivitec.Web.Core",
"unit_price": 123
}
}
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.Tradables.ApiGetTradeEventPositionEffectsRequest, Derivitec.Web.Core',
tradable_id: '<string>',
pricing_date: '2023-11-07T05:31:56Z',
next_trade_event: {
$type: 'Derivitec.Web.Core.TradeEvents.BuyEvent, Derivitec.Web.Core',
unit_price: 123
}
})
};
fetch('https://api.riskportal.activeviam.com/api/Tradable/GetTradeEventPositionEffects', 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/GetTradeEventPositionEffects",
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.Tradables.ApiGetTradeEventPositionEffectsRequest, Derivitec.Web.Core',
'tradable_id' => '<string>',
'pricing_date' => '2023-11-07T05:31:56Z',
'next_trade_event' => [
'$type' => 'Derivitec.Web.Core.TradeEvents.BuyEvent, Derivitec.Web.Core',
'unit_price' => 123
]
]),
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/GetTradeEventPositionEffects"
payload := strings.NewReader("{\n \"$type\": \"Derivitec.Web.Core.Tradables.ApiGetTradeEventPositionEffectsRequest, Derivitec.Web.Core\",\n \"tradable_id\": \"<string>\",\n \"pricing_date\": \"2023-11-07T05:31:56Z\",\n \"next_trade_event\": {\n \"$type\": \"Derivitec.Web.Core.TradeEvents.BuyEvent, Derivitec.Web.Core\",\n \"unit_price\": 123\n }\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/GetTradeEventPositionEffects")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"$type\": \"Derivitec.Web.Core.Tradables.ApiGetTradeEventPositionEffectsRequest, Derivitec.Web.Core\",\n \"tradable_id\": \"<string>\",\n \"pricing_date\": \"2023-11-07T05:31:56Z\",\n \"next_trade_event\": {\n \"$type\": \"Derivitec.Web.Core.TradeEvents.BuyEvent, Derivitec.Web.Core\",\n \"unit_price\": 123\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.riskportal.activeviam.com/api/Tradable/GetTradeEventPositionEffects")
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.Tradables.ApiGetTradeEventPositionEffectsRequest, Derivitec.Web.Core\",\n \"tradable_id\": \"<string>\",\n \"pricing_date\": \"2023-11-07T05:31:56Z\",\n \"next_trade_event\": {\n \"$type\": \"Derivitec.Web.Core.TradeEvents.BuyEvent, Derivitec.Web.Core\",\n \"unit_price\": 123\n }\n}"
response = http.request(request)
puts response.read_body{
"$type": "Derivitec.Web.Core.Tradables.ApiGetTradeEventPositionEffectsResponse, Derivitec.Web.Core",
"is_success": true,
"error_messages": [
"<string>"
],
"position_effects": [
{
"$type": "Derivitec.Web.Core.Tradables.PositionEffect, Derivitec.Web.Core",
"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
},
"quantity": 123
}
],
"pricing_date": "2023-11-07T05:31:56Z"
}Preview a trade event's position effects.
Previews position effects for applying one supplied next-event object to an existing tradable at the pricing date. It does not book those effects and is read-only.
POST
/
api
/
Tradable
/
GetTradeEventPositionEffects
Preview a trade event's position effects.
curl --request POST \
--url https://api.riskportal.activeviam.com/api/Tradable/GetTradeEventPositionEffects \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json-patch+json' \
--data '
{
"$type": "Derivitec.Web.Core.Tradables.ApiGetTradeEventPositionEffectsRequest, Derivitec.Web.Core",
"tradable_id": "<string>",
"pricing_date": "2023-11-07T05:31:56Z",
"next_trade_event": {
"$type": "Derivitec.Web.Core.TradeEvents.BuyEvent, Derivitec.Web.Core",
"unit_price": 123
}
}
'import requests
url = "https://api.riskportal.activeviam.com/api/Tradable/GetTradeEventPositionEffects"
payload = {
"$type": "Derivitec.Web.Core.Tradables.ApiGetTradeEventPositionEffectsRequest, Derivitec.Web.Core",
"tradable_id": "<string>",
"pricing_date": "2023-11-07T05:31:56Z",
"next_trade_event": {
"$type": "Derivitec.Web.Core.TradeEvents.BuyEvent, Derivitec.Web.Core",
"unit_price": 123
}
}
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.Tradables.ApiGetTradeEventPositionEffectsRequest, Derivitec.Web.Core',
tradable_id: '<string>',
pricing_date: '2023-11-07T05:31:56Z',
next_trade_event: {
$type: 'Derivitec.Web.Core.TradeEvents.BuyEvent, Derivitec.Web.Core',
unit_price: 123
}
})
};
fetch('https://api.riskportal.activeviam.com/api/Tradable/GetTradeEventPositionEffects', 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/GetTradeEventPositionEffects",
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.Tradables.ApiGetTradeEventPositionEffectsRequest, Derivitec.Web.Core',
'tradable_id' => '<string>',
'pricing_date' => '2023-11-07T05:31:56Z',
'next_trade_event' => [
'$type' => 'Derivitec.Web.Core.TradeEvents.BuyEvent, Derivitec.Web.Core',
'unit_price' => 123
]
]),
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/GetTradeEventPositionEffects"
payload := strings.NewReader("{\n \"$type\": \"Derivitec.Web.Core.Tradables.ApiGetTradeEventPositionEffectsRequest, Derivitec.Web.Core\",\n \"tradable_id\": \"<string>\",\n \"pricing_date\": \"2023-11-07T05:31:56Z\",\n \"next_trade_event\": {\n \"$type\": \"Derivitec.Web.Core.TradeEvents.BuyEvent, Derivitec.Web.Core\",\n \"unit_price\": 123\n }\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/GetTradeEventPositionEffects")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"$type\": \"Derivitec.Web.Core.Tradables.ApiGetTradeEventPositionEffectsRequest, Derivitec.Web.Core\",\n \"tradable_id\": \"<string>\",\n \"pricing_date\": \"2023-11-07T05:31:56Z\",\n \"next_trade_event\": {\n \"$type\": \"Derivitec.Web.Core.TradeEvents.BuyEvent, Derivitec.Web.Core\",\n \"unit_price\": 123\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.riskportal.activeviam.com/api/Tradable/GetTradeEventPositionEffects")
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.Tradables.ApiGetTradeEventPositionEffectsRequest, Derivitec.Web.Core\",\n \"tradable_id\": \"<string>\",\n \"pricing_date\": \"2023-11-07T05:31:56Z\",\n \"next_trade_event\": {\n \"$type\": \"Derivitec.Web.Core.TradeEvents.BuyEvent, Derivitec.Web.Core\",\n \"unit_price\": 123\n }\n}"
response = http.request(request)
puts response.read_body{
"$type": "Derivitec.Web.Core.Tradables.ApiGetTradeEventPositionEffectsResponse, Derivitec.Web.Core",
"is_success": true,
"error_messages": [
"<string>"
],
"position_effects": [
{
"$type": "Derivitec.Web.Core.Tradables.PositionEffect, Derivitec.Web.Core",
"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
},
"quantity": 123
}
],
"pricing_date": "2023-11-07T05:31:56Z"
}Authorizations
oauth2apikey
Body
application/json-patch+jsonapplication/jsontext/jsonapplication/*+json
JSON request with non-empty TradableId, PricingDate as a caller-time-zone calendar date, and non-null NextTradeEvent.
Selected tradable, pricing date, and next event used to request resulting position effects.
Response
Returns the projected position effects or errors.
Response envelope for the position effects of the selected tradable event.
Was this page helpful?