adriaparcerisassolana vs polygon 8
    Updated 2022-12-13
    WITH
    poly1 as (
    SELECT
    trunc(block_timestamp,'{{granularity}}') as date,
    count(distinct origin_from_address) as users,
    sum(users) over (order by date) as cum_users,
    count(distinct tx_hash) as transfers,
    sum(transfers) over (order by date) as cum_transfers
    from polygon.core.ez_matic_transfers where block_timestamp>=CURRENT_DATE- INTERVAL '{{period}}'
    group by 1),
    poly2 as (
    SELECT
    trunc(block_timestamp,'{{granularity}}') as date,
    count(distinct origin_from_address) as users,
    sum(users) over (order by date) as cum_users,
    count(distinct tx_hash) as transfers,
    sum(transfers) over (order by date) as cum_transfers
    from polygon.core.fact_token_transfers where block_timestamp>=CURRENT_DATE- INTERVAL '{{period}}'
    group by 1
    ),
    poly as (
    select x.date,
    x.users+y.users as users,
    x.cum_users+y.cum_users as cum_users,
    x.transfers+y.transfers as transfers,
    x.cum_transfers+y.cum_transfers as cum_transfers
    from poly1 x join poly2 y on x.date=y.date
    ),
    sol as (
    SELECT
    trunc(block_timestamp,'{{granularity}}') as date,
    count(distinct tx_from) as users,
    sum(users) over (order by date) as cum_users,
    count(distinct tx_id) as transfers,
    sum(transfers) over (order by date) as cum_transfers
    from solana.core.fact_transfers where block_timestamp>=CURRENT_DATE- INTERVAL '{{period}}'
    Run a query to Download Data