kiacryptoTotal fee generated per day
    Updated 2022-07-14
    with txs as (
    select lending_pool, blockchain, tx_hash
    from flipside_prod_db.crosschain.ez_borrowing

    union all
    select lending_pool, blockchain, tx_hash
    from flipside_prod_db.crosschain.ez_lending
    )

    select date_trunc('day', block_timestamp) as date, lending_pool, sum(tx_fee) as fee, 'Polygon' as type
    from polygon.core.fact_transactions t join txs tx on t.tx_hash = tx.tx_hash
    where blockchain = 'polygon'
    group by 1, 2

    union all

    select date_trunc('day', block_timestamp) as date, lending_pool, sum(tx_fee) as fee, 'Ethereum' as type
    from ethereum.core.fact_transactions t join txs tx on t.tx_hash = tx.tx_hash
    where blockchain = 'ethereum'
    group by 1, 2


    Run a query to Download Data