filbertsteinerTreasury
Updated 2023-11-24
999
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
›
⌄
-- Treasury
WITH WALLET_LIST AS (
SELECT
'MvYgbzyYqKPxPn5XVxiBTWReEsX4w52esLunKYQmvBW' AS TREASURY
),
cte_date (date_rec) as (
select
to_date('2023-03-07')
union
all
select
to_date(dateadd(day, 1, date_rec)) --or week, month, week, hour, minute instead of day
from
cte_date
where
date_rec < CURRENT_DATE()
),
INCOMING_HXD AS (
SELECT
BLOCK_TIMESTAMP,
DATE_TRUNC('Day', BLOCK_TIMESTAMP) AS DAY,
AMOUNT
FROM
solana.core.fact_transfers
WHERE
BLOCK_ID >= 181334924
AND TX_TO IN (
SELECT
*
FROM
WALLET_LIST
)
AND MINT = '3dgCCb15HMQSA4Pn3Tfii5vRk7aRqTH95LJjxzsG2Mug'
),
OUTGOING_HXD AS (
SELECT