Muzeproject base
Updated 2023-04-15
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
›
⌄
-- how do we get this to work with either project name or address, based on users input
-- select
-- tx_status,
date_trunc('day', a.block_timestamp) as day
-- from avalanche.core.fact_decoded_event_logs a
left join avalanche.core.dim_labels b on a.contract_address = b.address
where b.label_type in ( 'dex', 'nft', 'layer2', 'tokens' ) -- this helps so that you won't have alot of params for the remaining guys
and b.project_name = lower('{{Project_Name}}')
and a.block_timestamp >= '2023-01-01'
-- select
-- distinct c.from_address as user,
-- date_trunc('week', a.block_timestamp) as week
-- -- c.avax_value,
-- -- c.tx_hash
-- from avalanche.core.fact_decoded_event_logs a
-- left join avalanche.core.dim_labels b on a.contract_address = b.address
-- left join avalanche.core.fact_transactions c on a.tx_hash = c.tx_hash
-- and a.block_timestamp = c.block_timestamp
-- where b.project_name ilike 'trader joe'
-- and a.event_name = 'Swap'
-- and c.status = 'SUCCESS'
-- and avax_value > 0
-- -- select distinct project_name from avalanche.core.dim_labels
-- -- where label_type = 'defi'
Run a query to Download Data