CryptoIcicleUntitled Query
    Updated 2023-02-14
    -- Background: With the launch of Squid, Axelar’s General Message Passing functionality has entered the spotlight.
    -- The future is now – safe, secure cross-chain contract calls with tokens, enabling multi-step swaps with the click of a single button.
    -- However, GMP transfer volumes are not currently captured in Axelar’s token transfer volume reporting.

    with
    prices as (
    select
    date_trunc('day',recorded_at) as date,
    lower(symbol) as symbol,
    avg(price) as price_usd
    from osmosis.core.dim_prices
    where recorded_at >= CURRENT_DATE - {{n_days}}
    group by 1,2
    ),
    txns as (
    select
    regexp_substr(sender,'[a-zA-Z]+|\d+') as sender_chain,
    regexp_substr(receiver,'[a-zA-Z]+|\d+') as receiver_chain,
    concat(sender_chain,'-->',receiver_chain) as transfer_path,
    lower(split(currency,'-')[0]) as symbol,
    iff(symbol ilike 'u%', substring(symbol, 2, LEN(symbol)), symbol) as sym,
    iff(transfer_type = 'IBC_TRANSFER_IN', 'bridge_in', 'bridge_out') as router,
    t.*
    from axelar.core.fact_transfers t
    where transfer_type in ('IBC_TRANSFER_IN', 'IBC_TRANSFER_OUT')
    and block_timestamp >= CURRENT_DATE - {{n_days}}
    and sender_chain <> receiver_chain
    and decimal is not null
    ),
    p_txns as (
    select
    p.price_usd,
    (amount/pow(10,decimal)) * p.price_usd as token_amount_usd,
    t.*
    from txns t
    join prices p on t.block_timestamp::date = p.date and p.symbol = t.sym
    Run a query to Download Data