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
›
⌄
-- forked from 2023-07-26 08:49 PM @ https://flipsidecrypto.xyz/edit/queries/16f259ee-a232-4d1d-af3d-330ae67120a7
with gen AS
(with all_tx as (
select date_trunc('day', block_timestamp::date) as dt,
tx_hash, decoded_log:to::string as event_to,
decoded_log:from::string as event_from, decoded_log:tokenId::string as token_id
from ethereum.core.fact_decoded_event_logs
where block_timestamp BETWEEN '2021-04-15 19:56:00.000' AND '2023-07-28 13:43:36.000'
and contract_address = lower('0x57a204aa1042f6e66dd7730813f4024114d74f37')
and event_name = 'Transfer'
and token_id < 1001
),
transfers as
((SELECT
event_to as wallet,
dt,
'mint' as action,
1 as value
FROM all_tx
where event_from = '0x0000000000000000000000000000000000000000')
union all
(SELECT
event_to as wallet,
dt,
'gain' as action,
1 as value
FROM all_tx
where event_from != '0x0000000000000000000000000000000000000000')
union all
(SELECT
Run a query to Download Data