scottincryptoBadger Uniswap V3 Liquidity
Updated 2022-12-22
999
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
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