datavortexTrend
Updated 2024-11-20
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 staking AS (
SELECT
tx_hash,
staker_address,
amount_usd,
DATE_TRUNC('week', block_timestamp) AS staking_date
FROM
crosschain.olas.ez_olas_staking
),
daily_aggregates AS (
SELECT
staking_date,
SUM(amount_usd) AS "total amount usd",
COUNT(DISTINCT tx_hash) AS "total stakes",
COUNT(DISTINCT staker_address) AS "total stakers"
FROM
staking
GROUP BY
staking_date
)
SELECT
staking_date,
"total amount usd",
"total stakes",
"total stakers",
SUM("total amount usd") OVER (
ORDER BY
staking_date
) AS "cumulative total amount usd",
SUM("total stakes") OVER (
ORDER BY
staking_date
) AS "cumulative total stakes",
SUM("total stakers") OVER (
ORDER BY
staking_date
QueryRunArchived: QueryRun has been archived