Multipartite2023-01-04 By-chain cumulative rewards sent from pools (30 days of December 2022)
    Updated 2023-01-03
    WITH
    daily_sent AS (
    SELECT DISTINCT
    DATE(block_timestamp) AS date,
    SPLIT(pool_name, '.')[0] AS chain,
    -1 * SUM(rune_e8) OVER(PARTITION BY date, chain) AS daily_sent_e8
    FROM thorchain.core.fact_rewards_event_entries
    WHERE (rune_e8 < 0)
    AND date BETWEEN '2022-12-01' AND '2022-12-30'
    )

    SELECT date, chain,
    POWER(10,-8) * SUM(daily_sent_e8) OVER(PARTITION BY chain ORDER BY date ASC) AS cumulative_sent_rewards
    FROM daily_sent
    ORDER BY date DESC
    Run a query to Download Data