animatorstaked near
Updated 2022-11-09Copy 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
›
⌄
WITH stake AS (
SELECT POOL_ADDRESS, ROUND(SUM(STAKE_AMOUNT)/1e24,0) AS stake
FROM near.core.dim_staking_actions
WHERE ACTION='Stake'
GROUP BY 1
ORDER BY 2 DESC),
unstake AS (
SELECT POOL_ADDRESS, ROUND(SUM(STAKE_AMOUNT)/1e24,0) AS unstake
FROM near.core.dim_staking_actions
WHERE ACTION='Unstake'
GROUP BY 1
ORDER BY 2 DESC)
SELECT s.POOL_ADDRESS, stake - unstake AS staked
FROM stake s JOIN unstake u ON s.POOL_ADDRESS = u.POOL_ADDRESS
WHERE staked>0
Run a query to Download Data