SocioAnalyticaGMP and Transfers over time
    Updated 2024-10-20
    -- forked from SocioCrypto / GMP and Transfers over time @ https://flipsidecrypto.xyz/SocioCrypto/q/SmurgIuyOCls/gmp-and-transfers-over-time

    SELECT * ,
    sum(n_txs) over (partition by platform ORDER BY date) as cum_txs
    FROM (

    SELECT 'GMP' as type,
    platform,
    date_trunc('{{interval}}',block_timestamp) as date,
    count(DISTINCT tx_id) as n_txs
    FROM (
    SELECT 'squid' as platform,
    tx_id,
    block_timestamp
    FROM axelar.core.fact_msg_attributes
    WHERE ATTRIBUTE_VALUE = 'Event_ContractCallWithToken'
    UNION
    SELECT 'other[MintDAO Bridge | Prime Protocol | etc]' as platform,
    tx_id,
    block_timestamp
    FROM axelar.core.fact_msg_attributes a
    WHERE ATTRIBUTE_VALUE = 'Event_ContractCall'
    )
    GROUP BY date , platform
    UNION
    SELECT
    'TRANSFERS' as type,
    'satellite' as platform,
    date_trunc('{{interval}}',block_timestamp) as date,
    count(DISTINCT tx_hash) as n_txs
    FROM axelar.defi.ez_bridge_satellite
    GROUP BY date
    )
    ORDER BY date DESC , platform
    QueryRunArchived: QueryRun has been archived