hessDaily Activities by New Users
    Updated 2023-01-13
    with new as ( select min(block_timestamp::date) as date, from_address
    from ethereum.core.fact_transactions
    group by 2)
    ,
    staking as ( select tx_hash
    from ethereum.core.fact_event_logs
    where contract_address in ( '0xae7ab96520de3a18e5e111b5eaab095312d7fe84','0x2cac916b2a963bf162f076c0a8a4a8200bcfbfb4',
    '0x00000000219ab540356cbb839cbe05303d7705fa')
    and block_timestamp::date >= CURRENT_DATE - 30
    and event_name = 'Transfer' and event_inputs:from = '0x0000000000000000000000000000000000000000')
    ,
    liquidity as ( select tx_hash
    from ethereum.core.fact_event_logs
    where event_name ilike '%liquidity%'
    and block_timestamp >= CURRENT_DATE - 30)

    ,
    new_user as ( select DISTINCT from_address
    from new
    where date >= CURRENT_DATE - 30)
    ,
    final as ( select date(block_timestamp) as date,'Swap' as type, tx_hash, origin_from_address as user, amount_in_usd as amount
    from ethereum.core.ez_dex_swaps
    where origin_from_address in (select from_address from new_user)
    and date >= CURRENT_DATE - 30
    and amount_in_usd < 30000000
    UNION
    select date(block_timestamp) as date,'NFT Sales' as type, tx_hash, buyer_address as user , PRICE_USD as amount
    from ethereum.core.ez_nft_sales
    where buyer_address in (select from_address from new_user)
    and date >= CURRENT_DATE - 30
    UNION
    select date(block_timestamp) as date,'Mint NFT' as type, tx_hash, nft_to_address as user, MINT_PRICE_USD as amount
    from ethereum.core.ez_nft_mints
    where nft_to_address in (select from_address from new_user)
    and date >= CURRENT_DATE - 30
    Run a query to Download Data