articoloquintoDefi programs daily events over time
    Updated 2022-07-06
    select count(c."program") as "n. of events", date_trunc('day', c."BLOCK_TIMESTAMP") as "date" from(
    select p."program", case when l."LABEL_TYPE" = 'chadmin' then 'solana org' else l."LABEL_TYPE" end as "program type" from(
    select distinct PROGRAM_ID as "program"
    from solana.core.fact_events
    where BLOCK_TIMESTAMP between '2022-01-01' and '2022-06-06' and SUCCEEDED = 'TRUE') as p
    inner join(
    select ADDRESS, LABEL_TYPE
    from solana.core.dim_labels) as l
    on p."program" = l."ADDRESS") as pl
    inner JOIN(
    select PROGRAM_ID as "program", BLOCK_TIMESTAMP
    from solana.core.fact_events
    where BLOCK_TIMESTAMP between '2022-01-01' and '2022-06-06' and SUCCEEDED = 'TRUE') as c
    on c."program" = pl."program"
    where "program type" = 'defi'
    group by 2
    order by 2 asc


    Run a query to Download Data