hyoeisemanProfit for AMMs
Updated 2022-04-13Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
›
⌄
with sushiswap as (select block_timestamp::date as day,
sum(amount_usd*0.003) as profit_sushi
from ethereum.dex_swaps
where amount_usd is not null and platform = 'sushiswap'
and day >= '2022-01-01' and direction = 'OUT'
group by day),
uniswap as (select block_timestamp::date as dayy, sum(amount_usd*0.003) as profit_uniswap
from ethereum.dex_swaps
where amount_usd is not null and platform ilike 'uniswap%'
and dayy >= '2022-01-01' and amount_usd < 999999999 and direction = 'OUT'
group by dayy)
select day, profit_sushi, profit_uniswap, -profit_sushi+profit_uniswap as profit_difference
from sushiswap, uniswap where day = dayy
Run a query to Download Data