davidwallUntitled Query
    Updated 2023-01-14
    --credit : https://app.flipsidecrypto.com/velocity/queries/385abb7e-ddac-4e33-89f9-d6f267fec231
    select 'Ethereum' as chain,
    date_trunc(day,block_timestamp) as date,
    case when date >= '2022-12-24' and date < '2023-01-04' then 'Holidays'
    else 'Other Days' end as timespan,
    count (distinct tx_hash) as TX_Count,
    count (distinct origin_from_address) as Users_Count
    from ethereum.core.fact_event_logs
    where event_name = 'Swap'
    and block_timestamp >= '2022-12-17'
    and tx_status = 'SUCCESS'
    group by 1,2,3

    union ALL

    select 'Arbitrum' as chain,
    date_trunc(day,block_timestamp) as date,
    case when date >= '2022-12-24' and date < '2023-01-04' then 'Holidays'
    else 'Other Days' end as timespan,
    count (distinct tx_hash) as TX_Count,
    count (distinct origin_from_address) as Users_Count
    from arbitrum.core.fact_event_logs
    where event_name = 'Swap'
    and block_timestamp >= '2022-12-17'
    and tx_status = 'SUCCESS'
    group by 1,2,3

    union ALL

    select 'Avalanche' as chain,
    date_trunc(day,block_timestamp) as date,
    case when date >= '2022-12-24' and date < '2023-01-04' then 'Holidays'
    else 'Other Days' end as timespan,
    count (distinct tx_hash) as TX_Count,
    count (distinct origin_from_address) as Users_Count
    from avalanche.core.fact_event_logs
    Run a query to Download Data