BlazeArbitrum Swaps
Updated 2024-12-19
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 BSC Swaps @ https://flipsidecrypto.xyz/edit/queries/de0a692f-a2a5-4f33-b4e7-639f0e04d9b9
-- forked from Eth swaps @ https://flipsidecrypto.xyz/edit/queries/566b64cd-6c50-41ca-a883-3830ac225b10
select
week,
token,
symbol,
t1.amount_in as amount_in,
-t2.amount_out as amount_out,
case
when t1.amount_in is null then -t2.amount_out
when t2.amount_out is null then t1.amount_in
else t1.amount_in - t2.amount_out
end as net_amount_in,
case
when t1.amount_in_usd is null then -t2.amount_out_usd
when t2.amount_out_usd is null then t1.amount_in_usd
else t1.amount_in_usd - t2.amount_out_usd
end as net_amount_in_usd,
case
when t1.amount_in is null then t2.amount_out
when t2.amount_out is null then t1.amount_in
else t1.amount_in + t2.amount_out
end as net_vol,
case
when t1.amount_in_usd is null then t2.amount_out_usd
when t2.amount_out_usd is null then t1.amount_in_usd
else t1.amount_in_usd + t2.amount_out_usd
end as net_vol_usd
from
(
SELECT
date_trunc('week',BLOCK_TIMESTAMP) as week,
TOKEN_IN as token,
-- SYMBOL_IN as symbol,
QueryRunArchived: QueryRun has been archived