MufasaTotal GMP activity overview of axelar
    Updated 2023-02-14
    with final_data as (
    SELECT
    count(DISTINCT address) as total_users_count,
    count(DISTINCT tx_hash) as tx_hash_count,
    sum(CASE WHEN symbol_one is NULL THEN 0
    WHEN symbol_one LIKE 'axlUSDC' THEN volume / power(10, 6)
    ELSE volume * price / power(10, decimals) END) as amount
    FROM ( SELECT
    to_date(block_timestamp) as date,
    'arbitrum' as block_chain,
    origin_from_address as address,
    tx_hash,
    CASE WHEN TO_ADDRESS LIKE '0x0000000000000000000000000000000000000000' OR
    to_address LIKE lower('0xe432150cce91c13a887f7D836923d5597adD8E31') THEN raw_amount END as volume,
    CASE WHEN TO_ADDRESS LIKE '0x0000000000000000000000000000000000000000' OR
    to_address LIKE lower('0xe432150cce91c13a887f7D836923d5597adD8E31') THEN SYMBOL END as symbol_one
    FROM arbitrum.core.fact_token_transfers
    LEFT outer JOIN arbitrum.core.dim_contracts
    ON address = contract_address
    WHERE tx_hash in (
    SELECT
    tx_hash
    FROM
    arbitrum.core.fact_event_logs
    WHERE
    contract_address LIKE lower('0xe432150cce91c13a887f7D836923d5597adD8E31')
    AND EVENT_NAME is NULL
    )

    UNION

    SELECT
    to_date(block_timestamp) as date,
    'avalanche' as block_chain,
    origin_from_address as address,
    tx_hash,