Afonso_DiazTop symbol
Updated 2024-12-28
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
›
⌄
with
main as (
select
tx_id,
block_timestamp,
trader as user,
nvl(amount_in_usd, amount_out_usd) as amount_usd,
token_in_symbol as symbol_in,
token_out_symbol as symbol_out
from flow.defi.ez_dex_swaps
where block_timestamp::date between '{{ start_date }}' and '{{ end_date }}'
and amount_usd <= 1e6
),
symbol_data as (
select
symbol,
count(distinct tx_id) as transactions,
sum(amount_usd) as total_volume_usd
from (
select symbol_in as symbol, tx_id, amount_usd from main
union all
select symbol_out as symbol, tx_id, amount_usd from main
) combined
group by symbol
)
select
symbol,
transactions as total_transactions,
total_volume_usd
from symbol_data
where symbol != 'null'
order by total_volume_usd desc
QueryRunArchived: QueryRun has been archived