davidwallUntitled Query
Updated 2023-01-14Copy Reference Fork
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
›
⌄
--credit : https://app.flipsidecrypto.com/velocity/queries/1f75f025-efae-4061-989f-2aaef549409f
with base as (
select
block_timestamp::date as block_date,
tx_hash,
event_inputs:tokenId as token_id
from ethereum.core.fact_event_logs
where block_timestamp > '2022-06-07'
and origin_to_address = lower('0xa4b41efc1b6f73355c90119aeefddb1ffcf907b0')
and event_name = 'Transfer'
and contract_address = '0x6c4e530a6f5cec117bbd1ed2937584a71c75ca22' -- true freeze nft
and event_inputs:to = '0x0000000000000000000000000000000000000000' -- nft burned
)
select
tx.block_timestamp::date as date,
case
when count(distinct base.tx_hash) > 0 then count(distinct base.tx_hash)
else 0
end as n_early_redeems,
sum(n_early_redeems) over (order by date) as cumul_early_redeems
from base
full outer join ethereum.core.fact_transactions tx on base.block_date = tx.block_timestamp::date
where tx.block_timestamp::date > '2022-06-07'
group by date
Run a query to Download Data