purifYeet testnet v2 - Yeets data
Updated 2025-01-08
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 data as (select tx_hash,concat('0x',substr(TOPICS[1], 27,64)) as address,
utils.udf_hex_to_int(substr(substr(data, 0,66),3,66)) as timestamp,
(utils.udf_hex_to_int(substr(data,67,64))::int)/1e18 as pot_before,
(utils.udf_hex_to_int(substr(data,131,64))::int)/1e18 as pot_after,
utils.udf_hex_to_int(substr(data,323,64))::int as yeet_count,
utils.udf_hex_to_int(substr(data,387,64))::int as yeet_round,
from berachain.testnet.fact_event_logs
where ORIGIN_TO_ADDRESS=LOWER('0x14D65204c710997F595F4663f0451b66d3532f53')
and ORIGIN_FUNCTION_SIGNATURE='0x8bbefe4b'
and topics[0]='0x67e0e8435cacda8ca6cf3a8f63b166cdb95dc96e7d1c6e068009b117d47e1ac6'
order by block_timestamp),
sum_data as (select date_trunc('day',date(timestamp)) as day, sum(pot_after-pot_before) as yeet_amount, count(yeet_count) as yeets_count
from data
group by 1)
select day, yeet_amount, yeets_count,
sum(yeet_amount) over (order by day) as cum_yeet_amount,
sum(yeets_count) over (order by day) as cum_yeets_count,
(select count(DISTINCT address) from data) as yeetards,
(select max(yeet_round) from data) as latest_round,
(select max(pot_after-pot_before) from data) as biggest_yeet
from sum_data
order by day desc
QueryRunArchived: QueryRun has been archived