freemartianV3 AAVE Deposits
    Updated 2023-04-13
    with poly as (
    select
    count(distinct tx_hash) as deposit_count,
    count(distinct origin_from_address) as depositors_count,
    sum(event_inputs:value)/pow(10,18) as deposit_amount
    from polygon.core.fact_event_logs
    where origin_to_address = '0x794a61358d6845594f94dc1db02a252b5b4814ad'

    and event_name = 'Transfer'
    and event_inputs:to = '0xf329e36c7bf6e5e86ce2150875a84ce77f477375'),

    opi as (
    select
    count(distinct tx_hash) as deposit_count,
    count(distinct origin_from_address) as depositors_count,
    sum(event_inputs:value)/pow(10,18) as deposit_amount
    from optimism.core.fact_event_logs
    where origin_to_address = '0x794a61358d6845594f94dc1db02a252b5b4814ad'

    and event_name = 'Transfer'
    and event_inputs:to = '0xf329e36c7bf6e5e86ce2150875a84ce77f477375'
    ),
    arbi as (
    select
    count(distinct tx_hash) as deposit_count,
    count(distinct origin_from_address) as depositors_count,
    sum(event_inputs:value)/pow(10,18) as deposit_amount
    from arbitrum.core.fact_event_logs
    where origin_to_address = '0x794a61358d6845594f94dc1db02a252b5b4814ad'

    and event_name = 'Transfer'
    and event_inputs:to = '0xf329e36c7bf6e5e86ce2150875a84ce77f477375'
    )
    select deposit_count, depositors_count, deposit_amount, 'Polygon' as label
    from poly
    Run a query to Download Data