SniperUntitled Query
    Updated 2022-08-24
    with eth as ( select date(BLOCK_TIMESTAMP) as date, origin_from_address
    from ethereum.core.fact_event_logs
    where origin_to_address = lower('0xd9e1ce17f2641f24ae83637ab66a2cca9c378b9f')
    and event_name = 'Mint'
    )
    ,
    polygon as ( select date(BLOCK_TIMESTAMP) as date, origin_from_address as address
    from polygon.core.fact_event_logs
    where event_name = 'Mint' and origin_to_address = lower('0x1b02da8cb0d097eb8d57a175b88c7d8b47997506')
    UNION
    select date(BLOCK_TIMESTAMP) as date, origin_address as address
    from flipside_prod_db.polygon.udm_events
    where TO_ADDRESS = '0x1b02da8cb0d097eb8d57a175b88c7d8b47997506' and ORIGIN_FUNCTION_NAME = 'addLiquidity'
    )

    select 'Ethereum' as block , date, count(DISTINCT(origin_from_address)) as total, sum(total) over (order by date) as cum_tottal
    from eth
    where date >= CURRENT_DATE - 365
    group by 1,2
    UNION
    select 'Polygon' as block, date, count(DISTINCT(address)) as total, sum(total) over (order by date) as cum_tottal
    from polygon
    where date >= CURRENT_DATE - 365
    group by 1,2
    Run a query to Download Data