Kruys-CollinsUser's First Interaction DefI copy copy
Updated 2024-10-17Copy 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
26
27
28
29
30
31
32
33
34
35
36
›
⌄
-- forked from User's First Interaction DefI copy @ https://flipsidecrypto.xyz/studio/queries/56605478-69b8-4bf1-b917-581f22b9cbb9
WITH base AS (
SELECT
ft.block_timestamp,
ft.from_address,
ft.tx_hash,
ft.gas_price,
ft.gas_used,
ft.to_address,
dl.address,
dl.address_name,
dl.project_name,
dl.label_subtype,
dl.label_type,
el.contract_address,
el.contract_name,
el.decoded_log,
el.event_name,
el.event_index
FROM avalanche.core.fact_transactions ft
LEFT JOIN avalanche.core.dim_labels dl
ON ft.to_address = dl.address
LEFT JOIN avalanche.core.ez_decoded_event_logs el ON ft.tx_hash = el.tx_hash
WHERE
status = 'SUCCESS'
AND contract_address = '0x483416eb3afa601b9c6385f63cec0c82b6abf1fb'
)
SELECT
count(*) as Transactions,
count(case when event_name = 'Transfer' then 1 end ) as "Transfer Transactions",
count(case when event_name = 'Approval' then 1 end ) as "Approval Transactions"
FROM base
QueryRunArchived: QueryRun has been archived