strawbettyUST tx fee
    Updated 2022-04-04
    with swap_tx_ids as (
    select tx_id
    from terra.swaps
    where tx_status = 'SUCCEEDED'
    ), transactions as (
    select block_timestamp, fee
    from terra.transactions
    where tx_id IN (select * from swap_tx_ids)
    ), new_txs as (
    select block_timestamp::date, sum(fee[0]:amount[0]:amount/1e6)
    from transactions
    where fee[0]:amount[0]:denom = 'uusd'
    group by 1
    ), old_txs as (
    select block_timestamp::date, sum(fee[0]:amount/1e6)
    from transactions
    where fee[0]:denom = 'uusd'
    group by 1
    )

    select * from new_txs
    UNION
    select * from old_txs



    Run a query to Download Data