boomer77paraswap monthly vol
    Updated 2022-05-11
    with paraswap_contracts as(
    select
    '0x1bd435f3c054b6e901b7b108a0ab7617c808677b' as contract_address --Source: Paraswap deployer 2 https://etherscan.io/address/0xe6b692dcc972b9a5c3c414ac75ddc420b9edc92d 'Paraswap v4'
    union
    select
    '0xdef171fe48cf0115b1d80b88dc8eab59176fee57' as contract_address --'Paraswap v5'
    union
    select
    distinct from_address as contract_address
    from
    ethereum.udm_events
    where
    from_label = 'paraswap'
    ),
    paraswap_transactions as(
    select
    distinct tx_id
    from
    ethereum.udm_events
    where
    from_address in (
    select
    contract_address
    from
    paraswap_contracts
    )
    )
    select
    date_trunc('month', block_timestamp) as blocktime,
    platform,
    sum(amount_usd) as monthly_volume,
    SUM(monthly_volume) OVER(partition by platform ORDER BY blocktime asc ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS cumulative_volume
    from
    ethereum.dex_swaps
    where
    tx_id in (
    Run a query to Download Data