0xaimanwavault
Updated 2023-05-19
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 first_interactions AS (
SELECT
DATE_TRUNC('month', MIN(block_timestamp)) AS month,
from_address
FROM
avalanche.core.ez_token_transfers
WHERE
contract_address = '0xd26e504fc642b96751fd55d3e68af295806542f5'
AND to_address = '0x0000000000000000000000000000000000000000'
GROUP BY
from_address
),
monthly_summary AS (
SELECT
TO_CHAR(ft.month, 'YYYY-MM') AS "Month",
COUNT(*) AS "Number of New Depositor",
SUM(total_transactions) AS "Total Transactions",
SUM(total_amount) AS "Volume Deposited",
SUM(COUNT(*)) OVER (ORDER BY ft.month) AS "Cumulative New Depositor",
SUM(SUM(total_transactions)) OVER (ORDER BY ft.month) AS "Cumulative Total Transactions",
SUM(SUM(total_amount)) OVER (ORDER BY ft.month) AS "Cumulative Total Volume"
FROM
first_interactions ft
JOIN (
SELECT
from_address,
COUNT(*) AS total_transactions,
SUM(raw_amount / 10e17) AS total_amount
FROM
avalanche.core.ez_token_transfers
WHERE
contract_address = '0xd26e504fc642b96751fd55d3e68af295806542f5'
AND to_address = '0x0000000000000000000000000000000000000000'
GROUP BY
from_address
) t ON ft.from_address = t.from_address
Run a query to Download Data