ea1371Average volume of bridges to destination chains
    Updated 2022-11-18

    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 -365),

    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'
    when attribute_value like '%ibc/6F4968A73F90CF7DE6394BF937D6DF7C7D162D74D839C13F53B41157D315E05F%' then 'UST'
    when attribute_value like '%ibc/9117A26BA81E29FA4F78F57DC2BD90CD3D26848101BA880445F119B22A1E254E%' then 'ATOM'
    Run a query to Download Data