Flipside Axelar AnalystsITS Token Interchain Transfers Tracker
    Updated 2024-09-24
    with ITS as
    (select
    date_trunc('hour',created_at) as date,
    amount,
    call:chain as source_chain,
    call:returnValues:destinationChain as destination_chain,
    call:transaction:from as user,
    split_part(id,'_',0) as tx_id
    from axelar.axelscan.fact_gmp
    where call ilike '%0xb5fb4be02232b1bba4dc8f81dc24c26980de9e3c%' -- ITS Contract
    and (data:executed:receipt:logs[1]:address=lower('0x4e78011Ce80ee02d2c3e649Fb657E45898257815')
    or data:executed:receipt:logs[1]:address=lower('0xDCEFd8C8fCc492630B943ABcaB3429F12Ea9Fea2'))),

    PRICE as
    (select
    hour as date,
    avg(price) as avg_price
    from crosschain.price.ez_prices_hourly
    where token_address=lower('0x4e78011Ce80ee02d2c3e649Fb657E45898257815')
    group by date
    order by date)

    select ITS.date as date,
    amount,
    amount*avg_price as amount_usd,
    source_chain,
    destination_chain,
    user,
    tx_id
    FROM ITS LEFT JOIN PRICE
    ON ITS.date=PRICE.date
    where ITS.date between '{{Start_Date}}' and '{{End_Date}}'
    order by date
    QueryRunArchived: QueryRun has been archived