Abbas_ra21Wallets: Protocols
    Updated 2023-03-15
    with base AS (select
    BLOCK_TIMESTAMP,
    TX_HASH,
    lower(concat('0x',substr(DATA,27,40))) AS Address,
    ethereum.public.udf_hex_to_int(substr(DATA,67,65))/1e8 AS Amount
    from
    avalanche.core.fact_event_logs
    where
    CONTRACT_ADDRESS = '0x152b9d0fdc40c096757f570a51e494bd4b943e50'
    and TOPICS[0] = '0xc5532043e6f3d77e1c320ff59bd4157ca9075ef59f6b55ceab6c3f7d2f78c9ca'),
    tb AS (select
    DISTINCT Address AS Wallets
    from base )
    select
    Date_trunc('Day',Block_Timestamp)::DATE AS Day,
    PROJECT_NAME AS Project,
    LABEL_TYPE AS Type,
    Count(*) AS TX
    from avalanche.core.fact_transactions inner join avalanche.core.dim_labels on Address=to_Address where FROM_ADDRESS in (select Wallets from tb)
    group by 1,2,3

    Run a query to Download Data