banterlytics2023-04-07 03:42 AM
Updated 2023-04-07
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 all_tx AS (
SELECT
date_trunc('day', block_timestamp::date) AS dt,
tx_hash,
event_inputs:to::string AS event_to,
event_inputs:from::string AS event_from,
event_inputs:tokenId::string AS token_id
FROM ethereum.core.fact_event_logs
WHERE
contract_address = lower('0x7EA3Cca10668B8346aeC0bf1844A49e995527c8B') AND
event_name = 'Transfer' AND
block_timestamp > '2021-08-05'
UNION ALL
SELECT
date_trunc('day', block_timestamp::date) AS dt,
tx_hash,
event_inputs:to::string AS event_to,
event_inputs:from::string AS event_from,
event_inputs:tokenId::string AS token_id
FROM polygon.core.fact_event_logs
WHERE
contract_address = lower('0x05df72d911e52AB122f7d9955728BC96A718782C') AND
event_name = 'Transfer' AND
block_timestamp > '2022-01-05'
), transfers AS (
SELECT
event_to AS wallet,
dt,
'mint' AS action,
1 AS value
FROM all_tx
WHERE event_from = '0x0000000000000000000000000000000000000000'
UNION ALL
Run a query to Download Data