The annual return percent is displayed in multiple places on frontend:
on the strategy index tiles and the overview page, the data comes from metadata endpoint's key_metrics.cagr property
on the performance page, the value comes from the state endpoint's long_short_metrics_latest…annualised_return_percent property
Why two different data sources?
The data displayed on strategy tiles and overview page needs to be available fast and without massive data overhead, so it is included in the metadata endpoint.
The metrics table shown on the Performance page includes a lot more statistics, and is therefore included in the state endpoint (to avoid overloading metadata with too much data). The display of this data (order of elements, value formatting, labels, etc.) is fully controlled by the API – the only role that frontend plays is the table styling.
Steps to reproduce
The following steps can be reproduced for any strategy. Note that some strategies currently use live data for the metadatacagr value, while others use backtested data. When comparing the metadata and state values, be sure to compare the same source – the long_short_metrics_latest data includes both live_stats and backtested_stats. The example below uses live data for cagr, so it is compared the the live_stats data from the state endpoint.
Issue
A strategy's annual return percent value is available from both
metadata
andstate
endpoints, but the values don't match.Background
See item "B" in this discord thread.
The annual return percent is displayed in multiple places on
frontend
:metadata
endpoint'skey_metrics.cagr
propertystate
endpoint'slong_short_metrics_latest
…annualised_return_percent
propertyWhy two different data sources?
The data displayed on strategy tiles and overview page needs to be available fast and without massive data overhead, so it is included in the
metadata
endpoint.The metrics table shown on the Performance page includes a lot more statistics, and is therefore included in the
state
endpoint (to avoid overloadingmetadata
with too much data). The display of this data (order of elements, value formatting, labels, etc.) is fully controlled by the API – the only role thatfrontend
plays is the table styling.Steps to reproduce
The following steps can be reproduced for any strategy. Note that some strategies currently use live data for the
metadata
cagr
value, while others use backtested data. When comparing themetadata
andstate
values, be sure to compare the same source – thelong_short_metrics_latest
data includes bothlive_stats
andbacktested_stats
. The example below uses live data forcagr
, so it is compared the thelive_stats
data from thestate
endpoint.cagr
data frommetadata
endpoint:response
annualised_return_percent
data fromstate
endpoint:response
metadata
value is a decimal value and thestate
value is a formatted percent)0.05299…
=5.3%
frommetadata
vs.5.19%
fromstate