adriaparcerisasaxelar crosschains 3.4
    Updated 2024-09-25
    with
    satellite as (
    SELECT
    block_timestamp,tx_hash,
    source_chain,sender,destination_chain,
    token_symbol,amount
    from axelar.defi.ez_bridge_satellite
    ),
    squid as (
    SELECT
    block_timestamp,tx_hash,
    source_chain,sender,destination_chain,
    token_symbol,amount
    from axelar.defi.ez_bridge_squid
    ),
    total as (
    select * from satellite union select * from squid
    ),
    news as (
    select
    distinct sender,
    destination_chain,
    min(block_timestamp) as debut
    from total
    group by 1,2
    ),
    final as (
    SELECT
    trunc(debut,'{{granularity}}') as date,
    destination_chain,
    count(distinct sender) as new_users,
    sum(new_users) over (partition by destination_chain order by date) as cum_new_users
    from news
    group by 1,2
    )
    select * from final where date<trunc(current_date,'month') order by 1 asc
    QueryRunArchived: QueryRun has been archived