banbannardMerge Sushiswap LP 2
    Updated 2022-10-03
    with base as (select
    date_trunc('day', block_timestamp) as day,
    'Liquidity Providing',
    count(distinct(origin_from_address)) as wallets,
    count(distinct(tx_hash)) as tx_count,
    sum(amount_usd) as USD_Volume
    from ethereum.core.ez_eth_transfers
    where day > '2022-09-02'
    -- to pools
    and eth_to_address in (select contract_address
    from ethereum.sushi.ez_swaps)
    -- not swaps
    and tx_hash not in (select tx_hash
    from ethereum.sushi.ez_swaps
    where block_timestamp > '2022-09-02')
    group by 1,2

    union

    select
    date_trunc('day', block_timestamp) as day,
    'Liquidity Providing',
    count(distinct(origin_from_address)) as wallets,
    count(distinct(tx_hash)) as tx_count,
    sum(amount_usd) as USD_Volume
    from ethereum.core.ez_token_transfers
    where day > '2022-09-02'
    -- to pools
    and to_address in (select contract_address
    from ethereum.sushi.ez_swaps)
    -- not swaps
    and tx_hash not in (select tx_hash
    Run a query to Download Data