Flipside TeamVolume DEX Swaps Daily (7d)
Updated 2024-09-05
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
26
27
28
29
30
31
32
33
34
35
36
›
⌄
-- Credit mo115, marqu https://flipsidecrypto.xyz/edit/queries/48ff41e4-68a5-421c-a83a-6f2ffde60475
with
t1 as (
select
date(swaps.block_timestamp) as date,
case
when swaps.swap_program ilike '%raydium%' then 'Raydium'
when swaps.swap_program ilike '%jupiter%' then 'Jupiter'
when swaps.swap_program ilike '%phoenix%' then 'Phoenix'
when swaps.swap_program ilike '%meteora%' then 'Meteora'
when swaps.swap_program ilike '%orca%' then 'Orca'
when swaps.swap_program ilike '%bonk%' then 'Bonkswap'
when swaps.swap_program ilike '%saber%' then 'Saber'
when swaps.swap_program ilike '%stepn%' then 'Stepn Swap'
else swaps.swap_program
end as dex,
swaps.swap_to_amount as swap_amount_token,
swaps.swap_to_mint,
(swap_amount_token * prices.price) as swap_amount_usd
from solana.defi.fact_swaps swaps
inner join solana.price.ez_prices_hourly prices
on date_trunc('hour', swaps.block_timestamp) = prices.hour
and (swaps.swap_to_mint = prices.token_address
or (case when swaps.swap_to_mint = 'So11111111111111111111111111111111111111111'
then TRUE else FALSE end = prices.is_native
and prices.token_address is null
)
)
where swaps.block_timestamp >= current_date - 8
and swaps.block_timestamp < current_date
and succeeded
)
select
QueryRunArchived: QueryRun has been archived