gaonip[Staging] sushi LP
    Updated 2023-10-25
    with uni_lps as (
    SELECT
    liquidity_provider,
    date_trunc('day', block_timestamp) as date
    FROM
    ethereum.uniswapv3.ez_positions
    WHERE
    date >= CURRENT_DATE - 365 and is_active = TRUE
    GROUP BY
    1,2
    ),
    sushi_lps as (
    SELECT
    date_trunc('day', block_timestamp) as date,
    tx_hash,
    ORIGIN_FROM_ADDRESS as user_wallet,
    raw_amount,
    ORIGIN_TO_ADDRESS
    FROM
    ethereum.core.ez_token_transfers
    WHERE
    ORIGIN_TO_ADDRESS = '0xd9e1ce17f2641f24ae83637ab66a2cca9c378b9f'
    )

    SELECT
    COUNT(DISTINCT liquidity_provider) as num_LPs
    FROM
    uni_lps
    WHERE
    liquidity_provider in ((select user_wallet from sushi_lps))
    Run a query to Download Data