rackhaelFLOW HACKATHON new contracts test
Updated 2023-03-23
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
›
⌄
-- SELECT event_contract,
-- count(distinct tx_id) as num_contracts
-- FROM flow.core.fact_events
-- WHERE event_type = 'AccountContractAdded'
-- -- AND Block_timestamp :: date >= current_date - 30
-- AND tx_succeeded = 'true'
-- group by 1
--
-- SELECT *
-- FROM flow.core.fact_events
-- WHERE event_type = 'AccountContractAdded'
-- select *
-- from flow.core.fact_events
-- where event_contract = ('0x75c4cd8fd6df393d')
-- select *
-- from flow.core.dim_contract_labels
-- where contract_name = 'StaffCore'
WITH NEW_CONTRACTS AS(
SELECT date_trunc('day', block_timestamp) as date,
contract_name,
count(distinct tx_id) as daily_deployed_contracts
FROM flow.core.fact_events a JOIN flow.core.dim_contract_labels b ON
a.event_contract = b.event_contract
WHERE event_type = 'AccountContractAdded'
AND Block_timestamp :: date >= current_date - 30
AND tx_succeeded = 'true'
group by 1
order by 2 desc
),
Run a query to Download Data