zpoko2023-06-30 11:57 AM
    Updated 2023-06-30
    SELECT
    DATE_TRUNC('day', ft.block_timestamp) AS dt,
    sum(tx_fee) AS fees,
    sum(tx_fee) / count(DISTINCT ft.from_address) AS fee_p_add
    FROM
    ethereum.core.fact_transactions ft
    JOIN ethereum.core.dim_labels dl ON ft.to_address = dl.address
    WHERE
    dl.label_type IN ('layer2')
    AND ft.block_timestamp >= '2023-01-01'
    GROUP BY
    DATE_TRUNC('day', ft.block_timestamp)
    ORDER BY
    dt
    Run a query to Download Data