alirsuser06-02
Updated 2023-01-04
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 First_Act as (
SELECT
min(BLOCK_TIMESTAMP) as first_date
,tx_from
FROM osmosis.core.fact_transactions
GROUP by 2
)
SELECT
date_trunc('week', first_date ) as date,
action_name,
count(*)
FROM (
SELECT
first_date,
'Swap' as action_name
FROM osmosis.core.fact_swaps
JOIN First_Act
ON trader = tx_from
AND first_date = BLOCK_TIMESTAMP
UNION
SELECT
first_date,
'staking' as action_name
FROM osmosis.core.fact_staking
JOIN First_Act
ON TX_CALLER_ADDRESS = tx_from
AND first_date = BLOCK_TIMESTAMP
UNION
select 'Governance Vote' as Action_name,
block_timestamp,
t1.tx_id,
voter as osmouser
from osmosis.core.fact_governance_votes t1 join Finaltable t2 on t1.voter = t2.OSMO_User and t1.block_timestamp > t2.entry_date
where tx_status = 'SUCCEEDED'),
union
Run a query to Download Data