Examples & Use Cases
Risk Management Examples
VaR, stress testing workflows
⌘I
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
VaR, stress testing workflows
import requests
returns = [-0.02, 0.01, -0.015, 0.03, -0.01, 0.02, -0.005, 0.015]
response = requests.post(
"https://api.fincept.in/quantlib/risk/var-parametric",
headers={"X-API-Key": API_KEY},
json={
"returns": returns,
"confidence_level": 0.95,
"method": "normal"
}
)
var_95 = response.json()['data']['var']
print(f"95% VaR: {var_95}")
response = requests.post(
"https://api.fincept.in/quantlib/risk/stress-test",
headers={"X-API-Key": API_KEY},
json={
"portfolio_value": 1000000,
"positions": [...],
"scenarios": [
{"name": "2008_crisis", "shocks": {...}},
{"name": "covid_2020", "shocks": {...}}
]
}
)
