mo115Untitled Query
    WITH swap AS (
    SELECT
    date_trunc('{{Granularity}}', block_timestamp) AS date,
    COUNT(DISTINCT(tx_hash)) AS swap_tx_num
    FROM optimism.core.fact_event_logs
    WHERE origin_to_address IN ('0xe592427a0aece92de3edee1f18e0157c05861564', -- uniswap v3: router
    '0x68b3465833fb72a70ecdf485e0e4c7bd8665fc45') -- uniswap v3: router 2
    AND topics[0] IN ('0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67') -- 'Swap' event
    AND tx_status = 'SUCCESS'
    AND date >= CURRENT_DATE - INTERVAL '{{Period}}'
    GROUP BY date
    ORDER BY date ASC
    ),

    deposit AS (
    SELECT
    date_trunc('{{Granularity}}', block_timestamp) as date,
    COUNT(DISTINCT(tx_hash)) as deposit_tx_num
    FROM optimism.core.fact_event_logs
    WHERE origin_to_address = '0xc36442b4a4522e871399cd717abdd847ab11fe88'
    AND topics[0] = '0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c' -- 'Deposit' event
    AND tx_status = 'SUCCESS'
    AND date >= CURRENT_DATE - INTERVAL '{{Period}}'
    GROUP BY date
    ORDER BY date ASC
    ),
    withdraw AS (
    SELECT
    date_trunc('{{Granularity}}', block_timestamp) as date,
    COUNT(DISTINCT(tx_hash)) as withdraw_tx_num
    FROM optimism.core.fact_event_logs
    WHERE origin_to_address = '0xc36442b4a4522e871399cd717abdd847ab11fe88'
    AND topics[0] = '0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65' -- 'Withdraw' event
    AND tx_status = 'SUCCESS'
    AND date >= CURRENT_DATE - INTERVAL '{{Period}}'
    Run a query to Download Data