Expected shortfall calculation

What is this endpoint for?

This endpoint helps you calculate the expected shortfall (ES) and stressed ES. It is computed by a proprietary and thoroughly backtested methodology that accounts for the idiosyncrasies of crypto market structure. By convention, it's a forecasting ES, i.e.,the prediction of the potential loss for the next day. We introduced a mixture parameter that can provide either the ES, the stressed ES or a combination of the two (see the stress_parameter below).

Endpoint

https://us.market-api.kaiko.io/v2/data/analytics.v2/expected_shortfall

Parameters

Parameter
Required
Description

bases

Yes

List of portfolio base components. See Asset codes

Total must match quantities below. The order of bases and their respective quantities must match in the request.

quote

Yes

The fiat currency. Asset codes

quantities

Yes

Quantities list of base asset in the portfolio. Must match the number of bases. The order of quantities and their respective bases must match in the request.

risk_level

Yes

The risk level for the expected shortfall. Min: 0.90 (included)

Max: 1 (excluded)

start_time

Yes

First fixing of the calculation in ISO 8601 (inclusive).

end_time

Yes

Last fixing of the calculation in ISO 8601 (inclusive).

stress_parameter

No

Float between 0 and 1 that controls the blend between ES and Stressed ES.

It is 0 for ES and 1 for stressed ES.

It equals 0 by default.

reporting_currency

No

This allows you to express the final risk metrics in a specific fiat currency.

By default, expressed in USD.

sources

No

boolean. If true, returns all pair prices which were used to compute the expected shortfall. Default: false

Fields

Parameter
Description

es_time

The time at which the ES is computed.

expected_shortfall

Composed of two fields: value and risk_level (the expected shortfall estimator at the specified risk_level)

pair

The constituent pair. (showing only when sources is set to be true)

ref_price

The reference price per asset. (showing only when sources is set to be true)

date

The date of the reference price. (showing only when sources is set to be true)

Request examples

Response example

Last updated

Was this helpful?