hessAverage II
    Updated 2023-01-25
    with swap as ( select block_timestamp, tx_id, trader as user
    from terra.core.ez_swaps)
    ,
    vote as ( select block_timestamp, tx_id, voter as user
    from terra.core.fact_governance_votes)
    ,
    lp as ( select block_timestamp, tx_id, LIQUIDITY_PROVIDER_ADDRESS as user
    from terra.core.fact_lp_actions)
    ,
    transfers as ( select block_timestamp, tx_id, sender as user
    from terra.core.ez_transfers)
    ,
    nft_sales as ( select block_timestamp, tx_id, purchaser as user
    from terra.core.fact_nft_sales)
    ,
    nft_mint as ( select block_timestamp , tx_id, minter as user
    from terra.core.fact_nft_mints)
    ,
    staking as ( select block_timestamp, tx_id, delegator_address as user
    from terra.core.ez_staking)
    ,
    final as (select 'Swap' as type, date(block_timestamp) as date, count(DISTINCT(tx_id)) as total_tx, count(DISTINCT(user)) as total_user
    from swap
    where date >= CURRENT_DATE - 45
    group by 1,2
    UNION
    select 'Liquidity' as type, date(block_timestamp) as date, count(DISTINCT(tx_id)) as total_tx, count(DISTINCT(user)) as total_user
    from lp
    where date >= CURRENT_DATE - 45
    group by 1,2
    UNION
    select 'vote' as type, date(block_timestamp) as date, count(DISTINCT(tx_id)) as total_tx, count(DISTINCT(user)) as total_user
    from vote
    where date >= CURRENT_DATE - 45
    group by 1,2
    UNION
    Run a query to Download Data