purifBeradrome net revenue
Updated 2024-12-15
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
›
⌄
with prices as (
select value['address'] as token_address, value['price'] as usd_price from (
select live.udf_api(
'GET',
'https://bartio.api.oogabooga.io/v1/prices',
{'content-type': 'application/json',
'Authorization':'Bearer {{debank_key}}'},
{}
) as resp
), lateral flatten (input => resp:data)
),
tokens_data as (
select symbol, cast(token_address as varchar) as token_address, usd_price from prices p
join berachain.testnet.dim_contracts d on lower(d.ADDRESS)=lower(p.token_address)
),
weekly_prices as (
select
value:WEEK as WEEK,
value:YEET_P as yeet_p,
value:BERA_P as bera_p,
value:OBERO_P as obero_p
from (
select
live.udf_api('https://flipsidecrypto.xyz/api/v1/queries/5a8d2547-d25b-4901-882c-0cbda23ca633/data/latest') as resp
), lateral flatten (input => resp:data)
),
----------------------- BRIBES
bribes as (select concat('0x',substr(TOPICS[1], 27,64)) as bribe_contract from berachain.testnet.fact_event_logs
where origin_function_signature='0xd8867fc8'
and topics[0]='0xfe94179ec342e6971165e2fc4e2de38b70cd9d5c25f6850e0f34ce0247fba10e'),
weekly_bribes as (
select week, sum(usd_value) as bribes_value from (
select week, name,amount, price, (amount*price) as usd_value from (
QueryRunArchived: QueryRun has been archived