Popex404 Bridge metrics by Token
    Updated 2022-11-18
    -- Using the Bridge Query from alik110 https://app.flipsidecrypto.com/dashboard/05IlAD
    -- Sadly for this part i can't use my growth rate so i used the same query, but distinct charts

    with txtable as (
    select tx_id,
    ATTRIBUTE_VALUE as chain
    from axelar.core.fact_msg_attributes
    where ATTRIBUTE_KEY = 'destinationChain'
    and block_timestamp::date >= CURRENT_DATE - 30),

    usertable as (
    select ATTRIBUTE_VALUE as User,
    tx_id
    from axelar.core.fact_msg_attributes
    where tx_id in (select tx_id from txtable)
    and ATTRIBUTE_KEY = 'spender'),

    maintable1 as (
    select distinct user,
    date_trunc(day,block_timestamp) as date,
    t1.tx_id,
    chain,
    t1.ATTRIBUTE_VALUE
    from axelar.core.fact_msg_attributes t1 join txtable t2 on t1.tx_id = t2.tx_id
    join usertable t3 on t1.tx_id = t3.tx_id
    where MSG_TYPE = 'coin_spent'
    and ATTRIBUTE_INDEX = 1),

    labeltable as (
    select date,
    attribute_value,
    tx_id,
    user,
    chain,
    case when attribute_value like '%uaxl%' then 'AXL'
    when attribute_value like '%uusdc%' then 'USDC'
    Run a query to Download Data