0xsloaneBonkBets: Overall Stat Daily Token
Updated 2025-03-09Copy Reference Fork
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 h4wk / overall stat daily token @ https://flipsidecrypto.xyz/h4wk/q/D-tQnlj_VmR8/overall-stat-daily-token
-- forked from overall stat daily @ https://flipsidecrypto.xyz/studio/queries/255318b8-603c-4adf-8b4d-65955502bdf0
-- forked from overall stat @ https://flipsidecrypto.xyz/studio/queries/88fec4c8-f99c-4e57-a4f0-f5a533b2c30f
-- forked from base @ https://flipsidecrypto.xyz/studio/queries/af193c08-fc55-4a2a-b80c-e721d56f9e30
with latest_price as (
select hour::date as price_date,
token_address,
symbol,
avg(price) as price
from solana.price.ez_prices_hourly
where price_date = CURRENT_DATE - 1
group by 1,2,3
UNION
select hour::date as price_date,
'So11111111111111111111111111111111111111111' as token_address,
symbol,
avg(price) as price
from solana.price.ez_prices_hourly
where price_date = CURRENT_DATE - 1
and token_address = 'So11111111111111111111111111111111111111112'
group by 1,2,3
)
, betting as (
select
a.block_timestamp,
a.tx_id,
tx_from as user_address,
amount,
amount * price as amount_usd,
symbol
from solana.core.fact_transactions a
join lateral flatten (input => log_messages) logs
QueryRunArchived: QueryRun has been archived