adriaparcerisassquid avalanche gas
    Updated 2023-08-20
    with
    squid_avalanche as (
    SELECT
    x.block_timestamp,x.tx_hash,
    source_chain,sender,destination_chain,
    token_symbol,amount, tx_fee as usd_fee, gas_used, 'WAVAX' as symbol
    from axelar.core.ez_squid x
    join avalanche.core.fact_transactions y on x.tx_hash=y.tx_hash
    where source_chain='avalanche' --and y.block_timestamp>='2023-02-01'

    ),
    squid as (select * from squid_avalanche),
    debut as (
    select min(block_timestamp) as debut
    from axelar.core.ez_squid
    ),
    total as (
    select 'Squid' as bridge, * from squid
    ),
    final_squid as (
    SELECT
    trunc(block_timestamp,'{{granularity}}') as date,
    bridge,
    count(distinct tx_hash) as transactions,
    count(distinct sender) as active_users,
    avg(usd_fee*price)*transactions as fees_usd,
    avg(usd_fee*price) as avg_tx_fee,
    min(usd_fee*price) as min_fee,
    max(usd_fee*price) as max_fee,
    avg(gas_used*price)*transactions as gas_used,
    avg(gas_used*price) as avg_gas_used,
    min(gas_used*price) as min_gas_used,
    max(gas_used*price) as max_gas_used
    from total x
    join ethereum.core.fact_hourly_token_prices y on x.symbol=y.symbol
    group by 1,2 --select distinct symbol from ethereum.core.fact_hourly_token_prices where symbol ilike '%avax%'
    Run a query to Download Data