Pine Analyticstired-rose copy copy
Updated 2024-11-08
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 usdc_price as (
SELECT
date_trunc('day', hour) as day,
median(PRICE) as price_usdc
FROM
ethereum.price.ez_prices_hourly
WHERE token_address like lower('0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599')
GROUP BY
1
),
tab1 as (
SELECT
hour,
sum(
CASE
when type LIKE 'mint' then amount
else - amount
end
) as net_mint,
sum(net_mint) over (
ORDER BY
hour
) as supply
FROM
(
SELECT
date_trunc('hour', block_timestamp) as hour,
'mint' as type,
sum(mint_amount / power(10, 9)) as amount
FROM
solana.defi.fact_token_mint_actions
WHERE
mint LIKE 'cbbtcf3aa214zXHbiAZQwf4122FBYbraNdFqgw4iMij'
AND block_timestamp > '2024-04-01'
AND SUCCEEDED
GROUP BY
QueryRunArchived: QueryRun has been archived