kingharald-ethProtocols total fee used per day in last week
    Updated 2022-07-27
    select date, protocol, total_fee from (
    select date_trunc('day', block_timestamp) as date, tx:receipt[4]:outcome:executor_id as protocol, (sum(TRANSACTION_FEE) / pow(10,12)) as total_fee,
    ROW_NUMBER() OVER (PARTITION BY date ORDER BY total_fee DESC) as n
    from near.core.fact_transactions
    where block_timestamp >= current_date - interval '1 week'
    and protocol != ''
    and (
    protocol = 'v2.ref-finance.near' OR
    protocol = 'v2.ref-farming.near' OR
    protocol = 'v1.jumbo_exchange.near' OR
    protocol = 'app.nearcrowd.near' OR
    protocol = 'backend.v1.pembrock.near' OR
    protocol = 'operator.meta-pool.near' OR
    protocol = 'v1.orderbook.near' OR
    protocol = 'v1.pembrock.near'
    )
    group by protocol, date
    ) where n = 1 order by date asc
    Run a query to Download Data