scottincryptoBadger Uniswap V3 Liquidity
    Updated 2022-12-22
    with positions as (
    select
    nf_token_id
    -- , liquidity_provider
    , sum(liquidity_adjusted) as liquidity
    from ethereum.uniswapv3.ez_positions
    where pool_address = '0xe15e6583425700993bd08f51bf6e7b73cd5da91b'
    and is_active = TRUE
    group by 1
    )

    , nft_tx as (
    select
    tx_hash
    , block_timestamp
    , event_inputs:tokenId as token_id
    , event_inputs:from as from_address
    , event_inputs:to as to_address
    from ethereum.core.fact_event_logs
    where contract_address = '0xc36442b4a4522e871399cd717abdd847ab11fe88'
    and 1=1
    and block_timestamp > '2021-05-01'
    and event_inputs:tokenId::int in (select nf_token_id from positions)
    -- and event_inputs:tokenId::int = 294843
    and event_name = 'Transfer'
    )

    , wallet_calcs as (
    select
    token_id
    , from_address as wallet_address
    , -1 as nft_amt
    from nft_tx
    where from_address != '0x0000000000000000000000000000000000000000'
    union all
    select
    Run a query to Download Data