Total supply | |
---|---|
1 | 170283042.591944 |
Mrftitremendous-fuchsia
Updated 12 hours ago
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
›
⌄
-- Step 1: Define the new transfers CTE
with new_transfers as (
select
'0x' || RIGHT(TOPIC_1, 40) AS from_address,
'0x' || RIGHT(TOPIC_2, 40) AS to_address,
CAST(ethereum.public.udf_hex_to_int(SUBSTR(DATA, 3)) AS DECIMAL) / pow(10,18) AS amount
from swell.core.fact_event_logs
where ORIGIN_FUNCTION_SIGNATURE = '0xa9059cbb' -- transfer
and contract_address = '0x2826d136f5630ada89c1678b64a61620aab77aea'
),
-- Step 2: Check raw transfer data (for debugging)
raw_check as (
select
from_address,
to_address,
amount
from new_transfers
),
-- Step 3: Calculate inputs and outputs
tbl as (
select
to_address as "Address",
sum(amount) as "Input"
from new_transfers
group by 1
),
tbl2 as (
select
from_address as "Address",
sum(amount) as "Output"
from new_transfers
group by 1
),
-- Step 4: Combine and calculate balances
tbl3 as (
select
Last run: about 12 hours agoAuto-refreshes every 12 hours
1
20B
4s