maybeyonascowswap_sushi_daily
Updated 2022-04-19
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
cowswaps as (
select distinct tx_hash from ethereum_core.fact_event_logs
where contract_address = lower('0x9008d19f58aabd9ed0d60971565aa8510560ab41')
and event_name = 'Trade'
),
sushi_pools as (
select distinct pool_address from ethereum_core.dim_dex_liquidity_pools
where platform = 'sushiswap'
),
sushi_swaps as (
select
date(block_timestamp) as date,
count(distinct tx_hash) as sushi_txs
from ethereum_core.fact_event_logs
where event_name = 'Swap'
and tx_hash in (select * from cowswaps)
and contract_address in (select * from sushi_pools)
group by 1
),
total_cowswaps as (
select
date(block_timestamp) as date,
count(distinct tx_hash) as coswap_txs
from ethereum_core.fact_event_logs
where contract_address = lower('0x9008d19f58aabd9ed0d60971565aa8510560ab41')
and event_name = 'Trade'
group by 1
),
non_sushi as (
select
c.date,
coswap_txs - sushi_txs as non_sushi_txs
from total_cowswaps c join sushi_swaps s on c.date = s.date
)
Run a query to Download Data