Closed EvolveArt closed 5 months ago
Current Behavior
Right now, complex aggregations logic such as median, vwap imply very CPU intensive operations on the DB.
Expected Behavior
We should leverage Postgres materialized views and refresh these analytics at some defined frequency or every X requests.
List of views:
pair_id_vwap_preimage
pair_id_twap_preimage
pair_id_latest_median
The details should be discussed.
Current Behavior
Right now, complex aggregations logic such as median, vwap imply very CPU intensive operations on the DB.
Expected Behavior
We should leverage Postgres materialized views and refresh these analytics at some defined frequency or every X requests.
List of views:
pair_id_vwap_preimage
(c.f https://github.com/EkuboProtocol/indexer/blob/main/src/dao.ts#L620)pair_id_twap_preimage
pair_id_latest_median
The details should be discussed.