damidezusdb blast
Updated 2024-11-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
›
⌄
WITH usdbm AS (
--MINT
SELECT
'Mint' AS Type,
Amount_usd
FROM blast.core.ez_token_transfers
WHERE contract_address = '0x4300000000000000000000000000000000000003'
AND from_address = '0x0000000000000000000000000000000000000000'
UNION ALL
--Burn
SELECT
'Burn' AS Type,
Amount_usd
FROM blast.core.ez_token_transfers
WHERE contract_address = '0x4300000000000000000000000000000000000003'
AND to_address = '0x0000000000000000000000000000000000000000'
)
-- Calculate total minted and burned amounts
SELECT type,
SUM(Amount_usd) AS amount
FROM usdbm
GROUP BY type
-- Calculate net supply (Minted - Burned)
UNION ALL
SELECT 'Supply' AS type,
SUM(CASE WHEN type = 'Mint' THEN Amount_usd ELSE 0 END) -
SUM(CASE WHEN type = 'Burn' THEN Amount_usd ELSE 0 END) AS net
FROM usdbm
ORDER BY amount asc;
QueryRunArchived: QueryRun has been archived