maybeyonascons_buy_redeem_stats
Updated 2022-01-25
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
29
30
31
32
33
34
35
36
›
⌄
with
buys as (
select --distinct pool_name
block_timestamp,
tx_id,
-amount0_adjusted as tokens,
amount1_adjusted as eth,
-amount0_usd as value,
recipient as user
from uniswapv3.swaps
where (token0_address = lower('0x7A58c0Be72BE218B41C608b7Fe7C5bB630736C71')
or token1_address = lower('0x7A58c0Be72BE218B41C608b7Fe7C5bB630736C71'))
and pool_name in (
'PEOPLE-WETH 3000 60', 'PEOPLE-WETH 10000 200' -- 'PEOPLE-USDC 10000 200'
)
and amount0_usd < 0
),
people_redeems as (
select
block_timestamp,
tx_id,
event_inputs:holder::string as user,
event_inputs:returnAmount/pow(10,18) as eth_redeemed,
event_inputs:amount/pow(10,18) as tokens
from ethereum.events_emitted
where event_removed = 'FALSE'
and event_name = 'Redeem'
-- and event_inputs:preferUnstaked::string = 'false'
and event_inputs:returnAmount is not null
and event_inputs:"_projectId" = 36
and tx_to_address = '0xd569d3cce55b71a8a3f3c418c329a66e5f714431'
)
-- select user from people_redeems
-- where user in (select user from buys)
Run a query to Download Data