Flipside TeamMoM - 1 year
Updated 2024-09-22
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
›
⌄
-- forked from MoM @ https://flipsidecrypto.xyz/studio/queries/a1150646-ad8e-4d02-a5e8-6909c6088972
with MaticPrice as (select date_trunc('month', HOUR) AS date , median (PRICE) as MPrice
from ethereum.price.ez_prices_hourly
where SYMBOL = 'MATIC'
group by 1) ,
contracts as (with txs2 as (select TX_HASH
from ethereum.core.ez_decoded_event_logs
where CONTRACT_ADDRESS = '0x47cbe25bbdb40a774cc37e1da92d10c2c7ec897f'
and CONTRACT_NAME = 'Matic Validator'
and ORIGIN_FUNCTION_SIGNATURE = '0x6a761202'
and ORIGIN_TO_ADDRESS = '0xfa7d2a996ac6350f4b56c043112da0366a59b74c') ,
txs1 as (select TX_HASH
from ethereum.core.ez_decoded_event_logs
where CONTRACT_ADDRESS = '0x47cbe25bbdb40a774cc37e1da92d10c2c7ec897f'
and CONTRACT_NAME = 'Matic Validator'
and ORIGIN_FUNCTION_SIGNATURE = '0x4fdd20f1'
and ORIGIN_TO_ADDRESS = '0x5e3ef299fddf15eaa0432e6e66473ace8c13d908')
select date_trunc('month', BLOCK_TIMESTAMP) AS month,CONTRACT_ADDRESS
from txs2 t left join ethereum.core.ez_decoded_event_logs e on t.TX_HASH=e.TX_HASH
where EVENT_NAME = 'OwnershipTransferred'
union
select date_trunc('month', BLOCK_TIMESTAMP) AS month,CONTRACT_ADDRESS
from txs1 t left join ethereum.core.ez_decoded_event_logs e on t.TX_HASH=e.TX_HASH
where EVENT_NAME = 'OwnershipTransferred')
, tot1 as (
select
date_trunc('month', BLOCK_TIMESTAMP) AS month,
TO_ADDRESS as wallet,
(RAW_AMOUNT / 1e18) as amount,
CONTRACT_ADDRESS,
'stake' as action
from
ethereum.core.ez_token_transfers
where
CONTRACT_ADDRESS in (
QueryRunArchived: QueryRun has been archived