Abolfazl_771025Behavior of unstaker after three month
Updated 2022-07-19Copy Reference Fork
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
›
⌄
WITH delegate as (
SELECT
max(BLOCK_TIMESTAMP) as "date1",
delegator_address as "wallet",
SUM(amount / pow(10,6)) AS "DELIGATOR VOLUME"
FROM osmosis.core.fact_staking
WHERE ACTION = 'delegate'
AND tx_status = 'SUCCEEDED'
AND BLOCK_TIMESTAMP BETWEEN '2022-04-18' AND '2022-07-18'
group by 2
order by 1
), undelegate as (
SELECT
max(BLOCK_TIMESTAMP) as "date2",
delegator_address as "wallet",
'All_unstakers' as type,
SUM(amount / pow(10,6)) AS "UNDELIGATOR VOLUME"
FROM osmosis.core.fact_staking
WHERE ACTION = 'undelegate'
AND tx_status = 'SUCCEEDED'
AND BLOCK_TIMESTAMP BETWEEN '2022-04-18' AND '2022-07-18'
group by 2
order by 1
), swap as (
SELECT
max(BLOCK_TIMESTAMP) as "date3",
trader as "wallet",
SUM(from_amount / pow(10,6)) AS "SWAP VOLUME"
FROM osmosis.core.fact_swaps
WHERE from_currency = 'uosmo'
AND tx_status = 'SUCCEEDED'
AND BLOCK_TIMESTAMP BETWEEN '2022-04-18' AND '2022-07-18'
group by 2
order by 1
), pool as (
SELECT
Run a query to Download Data