sherrydUntitled Query
Updated 2022-07-20
99
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
›
⌄
select
nf_token_id, pool_address, pool_name, liquidity_provider,
case
when last_value(liquidity_adjusted) over
(partition by nf_token_id, pool_address, pool_name order by block_id asc) = 0
then block_id end closed_block,
last_value(block_id) over
(partition by nf_token_id, pool_address, pool_name order by block_id desc) opened_block,
tick_lower, tick_upper,
row_number() over (partition by nf_token_id, pool_address, pool_name order by block_id desc) row_number
from uniswapv3.positions
where BLOCK_TIMESTAMP>'2022-07-20'
and NF_TOKEN_ID = '271787'
select *
, last_value(liquidity_adjusted) over
(partition by nf_token_id, pool_address, pool_name order by block_id desc) number
from uniswapv3.positions where NF_TOKEN_ID = '271787'
select * from uniswapv3.pool_stats limit 100
select pool_address, date(block_timestamp) as day, max(block_id) block_id, avg(tick) tick
from uniswapv3.pool_stats
where BLOCK_TIMESTAMP > '2022-07-18'
group by 1,2
select * from uniswapv3.positions where BLOCK_TIMESTAMP>'2022-07-20' and nf_token_id = '203092'