View as Markdown

Risk-rate configs

A risk-rate config sets the risk-free rate a client's risk figures (Sharpe, Sortino, risk-adjusted return) use. A client without a config of its own uses its nearest configured parent client's rate, and a client with neither uses the zero rate. A config is dated: each version holds for a period, and a read shows the version in force on as_of (today when left out). Reading requires the reporting:read scope; every write requires reporting:write and write access to the client.

The risk figures read one rate per lens, which the nightly propagation sets from the config in force on its next run. The figures do not read dated rates, so a date after that run cannot take effect on its day: an effective_from after it, or a valid_to on or after it, answers 422. A new config can only be made once your move to v1 is done (409 legacy_managed before).

Data model

idstring or null

The config's id, the same through all its versions. null on an inherited row.

client_idstring

The client the row is for.

risk_rate_typestring or null

zero or cibor_3m_minus_050 on as_of. null when no version of the config holds on as_of.

asset_idstring or null

An optional proxy asset for the rate. On an inherited row only when you can read the parent client it comes from.

inheritedboolean

true when the client has no config of its own on as_of.

effective_sourcestring

own, ancestor (the nearest configured parent client) or default (the zero rate).

inherited_from_client_idstring or null

The parent client the rate comes from, when you can read it.

valid_fromISO 8601 date or null

First day of the version in force on as_of. null means from the beginning.

valid_toISO 8601 date or null

Last day of that version (inclusive). null means open-ended.

originstring or null

v1, or legacy for a config from the legacy platform. null on an inherited row.

versionsarray of object

Every version by start: risk_rate_type, asset_id, valid_from, valid_to. [] on an inherited row.

created_atstring or null

When the config was made; with created_by, updated_at and updated_by. A config from the legacy platform keeps its legacy creation time.

as_ofISO 8601 date

The day a single read or write answer shows the config at. A list carries it on the page instead.


GET/v1/risk-rate-configs

List risk-rate configs

One row per client you can read, in client id order, as on as_of. Only clients with a config of their own by default. An unknown query parameter is a 400.

Query parameters

as_ofISO 8601 date

The day to read. Today when left out; the page names it in as_of.

client_idstring

Only this client's row.

include_inheritedboolean

Also list clients without a config, with the rate they inherit.

limit, cursorinteger, string

Page size (default 100, at most 1000) and next_cursor from the previous page.

Request
GET/v1/risk-rate-configs
curl -G https://api.aleta.ai/v1/risk-rate-configs \
  -H "Authorization: Bearer {access_token}" \
  -d as_of=2026-06-30 \
  -d include_inherited=true

POST/v1/risk-rate-configs

Create a risk-rate config

Gives a client a config of its own. Returns 201 with the config as on today, or on its first day when it starts after today. Without effective_from the config holds from the beginning, or, when the client's earlier config has ended, from the day after it ended; with effective_from it holds from that day, and the client inherits before it. A client whose config holds on a day of the new period answers 409 already_configured, naming the first free day for effective_from when the config has ended (otherwise end it with DELETE or change it with PATCH). An effective_from after the propagation's next run answers 422 effective_from_in_future. A client_id you cannot read or an asset_id that names no asset is a 400, a client you cannot write a 403, and a client whose existing config this API cannot read a 409 unreadable_config. Until your move to v1 is done every create you may make answers 409 legacy_managed; an unreadable client_id (400) and a client you cannot write (403) are answered first. Takes ?dry_run=true and Idempotency-Key; the write is logged as a change with reason.

Body parameters

client_idstring

The client. Required.

risk_rate_typestring

zero or cibor_3m_minus_050. Required.

asset_idstring

An optional proxy asset.

effective_fromISO 8601 date

The first day the config holds.

reasonstring

Why, for the change list.

Request
POST/v1/risk-rate-configs
curl -X POST https://api.aleta.ai/v1/risk-rate-configs \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{ "client_id": "019eb3d2-fc2e-7782-973e-af78d0c10f01", "risk_rate_type": "zero" }'
Response
{
  "id": "0190a7b2-6b2c-7d11-a0f4-3c9e2b8d4e55",
  "client_id": "019eb3d2-fc2e-7782-973e-af78d0c10f01",
  "risk_rate_type": "zero",
  "asset_id": null,
  "inherited": false,
  "effective_source": "own",
  "inherited_from_client_id": null,
  "valid_from": null,
  "valid_to": null,
  "origin": "v1",
  "created_at": "2026-10-17T09:00:00Z",
  "created_by": "019eb3d2-fc2e-7782-973e-af78d0c10f99",
  "updated_at": "2026-10-17T09:00:00Z",
  "updated_by": "019eb3d2-fc2e-7782-973e-af78d0c10f99",
  "versions": [
    { "risk_rate_type": "zero", "asset_id": null, "valid_from": null, "valid_to": null }
  ],
  "as_of": "2026-10-17"
}

GET/v1/risk-rate-configs/{id}

Retrieve a risk-rate config

One config with all its versions; the flat fields are the version in force on as_of (today when left out), null when none is, and as_of names the day. An ended config still answers 200. Returns 404 for an unknown id or a client you cannot read, and 400 for a query parameter other than as_of.

Request
GET/v1/risk-rate-configs/{id}
curl https://api.aleta.ai/v1/risk-rate-configs/0190a7b2-6b2c-7d11-a0f4-3c9e2b8d4e55?as_of=2025-12-31 \
  -H "Authorization: Bearer {access_token}"

PATCH/v1/risk-rate-configs/{id}

Change a risk-rate config

Send risk_rate_type, asset_id (null clears it) or both; neither is a 400. Returns 200 with the config as a read today shows it.

Without effective_from the call is a correction: the version in force today (or the last one) is rewritten in its whole period. With effective_from it is a change: the version in force that day ends the day before, and the new values hold from that day to its old end; the config keeps both versions. The risk figures do not read dated rates (see above): they use the rate the next propagation sets, so a change dated in the past reaches the figures before its day too. A date outside the config's versions answers 422 effective_from_outside_config, and one after the propagation's next run 422 effective_from_in_future. A config from the legacy platform answers 409 legacy_managed until your move to v1 is done. Takes ?dry_run=true and Idempotency-Key; logged as a change with reason.

Request
PATCH/v1/risk-rate-configs/{id}
curl -X PATCH https://api.aleta.ai/v1/risk-rate-configs/0190a7b2-6b2c-7d11-a0f4-3c9e2b8d4e55 \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{ "risk_rate_type": "cibor_3m_minus_050", "effective_from": "2026-01-01", "reason": "new policy" }'

DELETE/v1/risk-rate-configs/{id}

End a risk-rate config

Ends the config after valid_to (the day before the rate next reaches the lenses when left out), and the client inherits again from the next day. Returns 200 with the ended config as on its last day (as_of is the earlier of valid_to and today). A config that never came into force is removed for good and answers 204. An ended config answers 409 already_ended, a valid_to before its first day 400, and a valid_to on or after the propagation's next run 422 valid_to_in_future. A config from the legacy platform answers 409 legacy_managed until your move to v1 is done. Takes ?dry_run=true and Idempotency-Key; logged as an end with reason.

Query parameters

valid_toISO 8601 date

The last day the config holds.

reasonstring

Why, for the change list.

Request
DELETE/v1/risk-rate-configs/{id}
curl -X DELETE "https://api.aleta.ai/v1/risk-rate-configs/0190a7b2-6b2c-7d11-a0f4-3c9e2b8d4e55?valid_to=2026-10-16&reason=client%20left" \
  -H "Authorization: Bearer {access_token}"