nitsTransactions made and amount staked
Updated 2022-05-25
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 a AS (
SELECT DISTINCT tx_id
FROM ethereum.events_emitted
WHERE contract_address = LOWER('0xa5f2211B9b8170F694421f2046281775E8468044')
), b AS (
SELECT *
FROM ethereum.events_emitted e
JOIN a ON a.tx_id = e.tx_id
WHERE tx_to_address = LOWER('0x815c23eca83261b6ec689b60cc4a58b54bc24d8d')
AND event_name = 'Deposit'
),
a_ AS (
SELECT DISTINCT tx_id
FROM ethereum.events_emitted
WHERE contract_address = LOWER('0xa5f2211B9b8170F694421f2046281775E8468044')
), b_ AS (
SELECT *
FROM ethereum.events_emitted e
JOIN a_ ON a_.tx_id = e.tx_id
WHERE tx_to_address = LOWER('0x815c23eca83261b6ec689b60cc4a58b54bc24d8d')
AND event_name = 'Withdraw'
),
staked_data as
(SELECT tx_from_address, sum(event_inputs:value)/pow(10,18) as amt, count(*) as total_txs from b
GROUP by 1 ),
unstaked_amt as
(SELECT tx_from_address, sum(event_inputs:amount)*(-1)/pow(10,18) as amt, count(*) as total_txs from b_
GROUP by 1),
participant as ( (SELECT tx_from_address, sum(amt) as net_thor, sum(total_txs) as total_tx
from
(SELECT * from staked_data
UNION ALL
SELECT * FROM unstaked_amt )
GROUP by 1
)),
participants as
Run a query to Download Data