View as Markdown

Performance

Daily and accumulated performance metrics in the context of a given period.

Data model

JSON:API resource type: performance.

accumulatedReturnnumber

Total profit/loss since the beginning of the period.

accumulatedTwrnumber

Time-weighted return (TWR) since the beginning of the period.

ccyCodestring

ISO 4217 code for the currency (CCY) in which the data is reported.

dailyNetCashFLownumber

Net cash flow on the day. Note the capital L in the attribute name.

dailyReturnnumber

Profit/loss on the day.

dailyTwrnumber

Time-weighted return (TWR) of the day.

datestring

ISO 8601 representation of the day on which the data holds.

Relationships

reportingEntityreporting-entity

Required.

depositorydepository

Optional.

portfolioportfolio

Optional.

assetasset

Optional.

assetClassasset-class

Optional.

assetClassDetailedasset-class-detailed

Optional.


GET/api/v2/performance/reporting-entities/{id}

Performance series

Get performance metrics in the scope of a reporting entity in a given period. The default behavior of the endpoint is to aggregate performance for the entire reporting entity, while more granular data can be retrieved by specifying an expand parameter.

Path parameters

idstring

Required. Identifier for the reporting entity.

Query parameters

expandstring

Allows for expansion of the data from the total reporting entity level to lower levels. Possible values: portfolios, depositories, assets, assetClasses, assetClassesDetailed. Multiple values can be passed as a comma separated list, e.g. portfolios,assets. The v3 names (instruments, instrumentClasses, instrumentClassesDetailed) are rejected on /api/v2/performance with a 400; /api/v2/summarized-performance accepts them and treats them as their asset equivalents.

fromDatestring

Required. First day in the period, yyyy-MM-dd.

includestring

Optional. Allows for inclusion of related data. Possible value: asset, which requires expand to contain assets (otherwise 400 Cannot include asset data if 'expand' is not set to 'assets'.). Any other value is ignored.

toDatestring

Required. Last day in the period, yyyy-MM-dd.

An unknown expand value is 400 Invalid expand parameter: {expand}. Supported values: portfolios, depositories, assets, assetClasses, assetClassesDetailed. An unknown reporting entity, or one you cannot see, is 404. A missing or empty date is 400, a date not in yyyy-MM-dd format is 422, and fromDate after toDate is 400.

Request
GET/api/v2/performance/reporting-entities/{id}
curl -G https://api.aleta.ai/api/v2/performance/reporting-entities/649ad926fc1a10be9e2ea241 \
  -H "Authorization: Bearer {access_token}" \
  -d fromDate=2024-06-03 \
  -d toDate=2024-06-04
Response
{
  "data": [
    {
      "type": "performance",
      "id": "c07hD3wE_S7mfh8Bzz6kYA",
      "attributes": {
        "date": "2024-06-03",
        "ccyCode": "DKK",
        "dailyNetCashFLow": 0,
        "dailyReturn": 768476,
        "dailyTwr": 0.0053,
        "accumulatedReturn": 768476,
        "accumulatedTwr": 0.0053
      },
      "relationships": {
        "reportingEntity": {
          "data": { "type": "reporting-entity", "id": "649ad926fc1a10be9e2ea241" }
        }
      }
    },
    {
      "type": "performance",
      "id": "IrPiqdmtYnx_XSxUpenj9Q",
      "attributes": {
        "date": "2024-06-04",
        "ccyCode": "DKK",
        "dailyNetCashFLow": 0,
        "dailyReturn": 843334,
        "dailyTwr": 0.0045,
        "accumulatedReturn": 843334,
        "accumulatedTwr": 0.0045
      },
      "relationships": {
        "reportingEntity": {
          "data": { "type": "reporting-entity", "id": "649ad926fc1a10be9e2ea241" }
        }
      }
    }
  ]
}

GET/api/v2/summarized-performance/reporting-entities/{id}

Summarized performance

One summarized-performance resource per currency and expanded grouping: the latest day of that grouping in the window, with window, month-to-date and day-to-date figures. Month-to-date covers the month of toDate; day-to-date figures are 0 when the grouping has no row on toDate.

Takes the same query parameters as the performance series. include=asset requires expand to contain assets itself (instruments does not count).

Attributes (in emitted order)

accumulatedNetCashFlownumber

Sum of net cash flow over the window.

accumulatedReturnnumber

Sum of return over the window.

accumulatedTwrnumber

Chained TWR over the window.

ccyCodestring

Currency of the figures.

dayToDateNetCashFlownumber

Net cash flow on toDate.

dayToDateReturnnumber

Return on toDate.

dayToDateTwrnumber

TWR on toDate.

datedate

The grouping's latest date in the window.

monthToDateNetCashFlownumber

Net cash flow in the month of toDate.

monthToDateReturnnumber

Return in the month of toDate.

monthToDateTwrnumber

Chained TWR in the month of toDate.

Errors (in the order they are checked)

  • 400 Invalid expand parameter: {expand}. Supported values: portfolios, depositories, assets, assetClasses, assetClassesDetailed.
  • 400 Missing or empty query parameter: fromDate or toDate
  • 422 Dates must use the following format: yyyy-MM-dd.
  • 400 FromDate must be before toDate.
  • 500 An error occurred while processing your request. — {id} is not a 24-character hex ObjectId.
  • 404 'reporting-entity' resource with ID '{id}' not found.
  • 400 Cannot include asset data if 'expand' is not set to 'assets'.
Request
GET/api/v2/summarized-performance/reporting-entities/{id}
curl -G https://api.aleta.ai/api/v2/summarized-performance/reporting-entities/{id} \
  -H "Authorization: Bearer {access_token}" \
  -d fromDate=2024-01-01 \
  -d toDate=2024-01-02 \
  -d expand=portfolios
Response
{
  "data": [
    {
      "type": "summarized-performance",
      "id": "ceHxkb61yDEOD3ibMr1GYA",
      "attributes": {
        "accumulatedNetCashFlow": 14,
        "accumulatedReturn": 14,
        "accumulatedTwr": 0,
        "ccyCode": "EUR",
        "dayToDateNetCashFlow": 11,
        "dayToDateReturn": 11,
        "dayToDateTwr": 0,
        "date": "2024-01-02",
        "monthToDateNetCashFlow": 14,
        "monthToDateReturn": 14,
        "monthToDateTwr": 0
      },
      "relationships": {
        "reportingEntity": {
          "data": { "id": "6710efbc34673a0a646a45de", "type": "reporting-entity" }
        },
        "portfolio": {
          "data": { "id": "6710efbc34673a0a646a45e1", "type": "portfolio" }
        }
      }
    }
  ]
}