OneDataAnalystWeekly Matic Staked
Updated 2022-09-22Copy 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
›
⌄
with T1 as (
SELECT Date_trunc('Week',BLOCK_TIMESTAMP) AS Date, TO_ADDRESS AS Staker, RAW_AMOUNT/1e18 AS Amount, TX_HASH,
CASE
when contract_address= '0x03a97594aa5ece130e2e956fc0ced2fea8ed8989' then 'aMATICb (Ankr)'
when contract_address= '0x3a58a54c066fdc0f2d55fc9c89f0415c92ebf3c4' then 'stMATIC (Lido)'
when contract_address= '0x7ed6390f38d554b8518ef30b925b46972e768af8' then 'csMATIC (ClayStack)'
when contract_address= '0x3ad736904e9e65189c3000c7dd2c8ac8bb7cd4e3' then 'MaticX (Stader)'
END AS Liquid_token
FROM polygon.core.fact_token_transfers
WHERE contract_address in (
'0x03a97594aa5ece130e2e956fc0ced2fea8ed8989',
'0x3a58a54c066fdc0f2d55fc9c89f0415c92ebf3c4',
'0x7ed6390f38d554b8518ef30b925b46972e768af8',
'0x3ad736904e9e65189c3000c7dd2c8ac8bb7cd4e3' )
AND from_address = '0x0000000000000000000000000000000000000000'
)
SELECT
Date,
Liquid_token,
COUNT(DISTINCT TX_HASH) AS Transactions,
COUNT(DISTINCT Staker)AS Stakers,
SUM(Amount) AS Amount
FROM t1
GROUP BY 1,2;
Run a query to Download Data