adriaparcerisasaxelar crosschains 4.1 squid
    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 'Satellite' as bridge,* from satellite union select 'Squid' as bridge, * from squid
    ),
    prices as (
    select
    trunc(hour,'day') as day,
    symbol,
    avg(price) as price_usd
    from crosschain.price.ez_prices_hourly
    group by 1,2
    ),
    final as (
    SELECT
    bridge,
    count(distinct tx_hash) as transactions,
    count(distinct sender) as active_users,
    sum(amount*price_usd) as volume_usd
    from total x
    join prices y on trunc(x.block_timestamp,'day')=y.day
    and token_symbol=symbol
    where amount*price_usd<1e8 and bridge = 'Squid'
    QueryRunArchived: QueryRun has been archived