SocioCryptouser activities
Updated 2023-02-08Copy Reference Fork
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 txns as (
SELECT tx_from as wallet,
count(DISTINCT tx_id) as n_txns,
sum(regexp_substr(fee,'\\d*')) as tx_fee
FROM osmosis.core.fact_transactions
WHERE tx_succeeded = 'TRUE'
GROUP BY wallet
),
governance as (
SELECT voter as wallet,
sum(vote_weight) as n_votes,
count(DISTINCT proposal_id) as n_proposals
FROM osmosis.core.fact_governance_votes
WHERE tx_succeeded = 'TRUE'
GROUP by wallet
),
avg_osmo_staked as (
SELECT address as wallet,
avg(balance)/pow(10,6) as avg_stsked
FROM osmosis.core.fact_daily_balances
WHERE balance_type = 'staked'
AND currency = 'uosmo'
AND date BETWEEN CURRENT_DATE - interval '1 day, 1 month' AND CURRENT_DATE-1
GROUP BY wallet
),
avg_osmo_liquid as (
SELECT address as wallet,
avg(balance)/pow(10,6) as avg_liquid
FROM osmosis.core.fact_daily_balances
WHERE balance_type = 'liquid'
AND currency = 'uosmo'
AND date BETWEEN CURRENT_DATE - interval '1 day, 1 month' AND CURRENT_DATE-1
GROUP BY wallet
),
interchain as (
SELECT c.attribute_value as wallet_address
Run a query to Download Data