Skip to content

Refactor hourly pnl tables #77

@Tburm

Description

@Tburm

The core system contains a complex set of tables to calculate pnls for each collateral type in each pool. There are likely optimizations can be made in these tables to simplify the calculation and enable more efficient materialization. The complex queries result in long query times and large join in order to "forward fill" data.

Although this was originally designed to calculate incrementally, some data quality issues arose so it was reverted to a table materialization. It should be possible to use incremental materialization here to speed up the dbt build.

Tasks:

  • Review and optimize hourly pnl tables in the core system: fct_pool_pnl_hourly, fct_pool_rewards_hourly, fct_pool_issuance
  • Optimize query times and reenable incremental table materialization if possible

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions