adriaparcerisasaxelar crosschains 5.1
    Updated 2024-04-27
    with
    satellite as (
    SELECT
    block_timestamp,tx_hash,
    source_chain,sender,destination_chain,receiver,
    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
    ),
    prices as (
    select
    trunc(hour,'day') as day,
    symbol,
    avg(price) as price_usd
    from crosschain.price.ez_hourly_token_prices
    group by 1,2
    ),
    eth as (
    SELECT
    label_type,
    count(distinct x.tx_hash) as transactions,
    count(distinct x.sender) as active_users,
    sum(x.amount*price_usd) as volume_usd
    from total x
    join prices y on trunc(x.block_timestamp,'day')=y.day and token_symbol=symbol
    join ethereum.core.dim_labels on receiver=address
    QueryRunArchived: QueryRun has been archived