Eman-RazTotal Swap Volume By Chain
Updated 2024-08-04
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
›
⌄
with final_table as (
----------------------------------------------Ethereum------------------------------------------------------
with ethereum as (select date_trunc('{{Time_Frame}}',block_timestamp) as "Date", sum(amount_in_usd) as "Swap Volume (USD)", 'Ethereum' as "Chain"
from ethereum.defi.ez_dex_swaps
where (token_in=lower('0x2598c30330D5771AE9F983979209486aE26dE875') or
token_out=lower('0x2598c30330D5771AE9F983979209486aE26dE875'))
and (block_timestamp::date between '{{Start_Date}}' and '{{End_Date}}')
group by 1
order by 1),
----------------------------------------------Base------------------------------------------------------
base as (select date_trunc('{{Time_Frame}}',block_timestamp) as "Date", sum(amount_in_usd) as "Swap Volume (USD)", 'Base' as "Chain"
from base.defi.ez_dex_swaps
where (token_in=lower('0x2598c30330D5771AE9F983979209486aE26dE875') or
token_out=lower('0x2598c30330D5771AE9F983979209486aE26dE875'))
and (block_timestamp::date between '{{Start_Date}}' and '{{End_Date}}')
group by 1
order by 1),
----------------------------------------------Arbitrum------------------------------------------------------
arbitrum as (select date_trunc('{{Time_Frame}}',block_timestamp) as "Date", sum(amount_in_usd) as "Swap Volume (USD)", 'Arbitrum' as "Chain"
from arbitrum.defi.ez_dex_swaps
where (token_in=lower('0x2598c30330D5771AE9F983979209486aE26dE875') or
token_out=lower('0x2598c30330D5771AE9F983979209486aE26dE875'))
and (block_timestamp::date between '{{Start_Date}}' and '{{End_Date}}')
group by 1
order by 1),
----------------------------------------------BSC------------------------------------------------------
bsc as (select date_trunc('{{Time_Frame}}',block_timestamp) as "Date", sum(amount_in_usd) as "Swap Volume (USD)", 'BSC' as "Chain"
from bsc.defi.ez_dex_swaps
where (token_in=lower('0x2598c30330D5771AE9F983979209486aE26dE875') or
Auto-refreshes every 24 hours
QueryRunArchived: QueryRun has been archived