0-MIDCopy of swap tx and user on camelot vs gmx
Updated 2023-03-07
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
›
⌄
with tab1 as (
select ORIGIN_FROM_ADDRESS as swapper,TX_STATUS
from arbitrum.core.fact_event_logs
where ORIGIN_TO_ADDRESS='0xc873fecbd354f5a56e00e710b90ef4201db2448d' --camelot Dex
and TX_STATUS='SUCCESS'
and BLOCK_TIMESTAMP>='2023-01-01'
and EVENT_NAME='Swap'
),
tab2 as (
select ORIGIN_FROM_ADDRESS as swapper,TX_STATUS
,TX_HASH
from arbitrum.core.fact_event_logs
where ORIGIN_TO_ADDRESS='0xabbc5f99639c9b6bcb58544ddf04efa6802f4064' --GMX Dex
and TX_STATUS='SUCCESS'
and BLOCK_TIMESTAMP>='2023-01-01'
and EVENT_NAME='Swap')
select
case
when ORIGIN_FROM_ADDRESS in (select swapper from tab1) and ORIGIN_FROM_ADDRESS not in
(select swapper from tab2)then 'only camelot'
when ORIGIN_FROM_ADDRESS in (select swapper from tab2) and ORIGIN_FROM_ADDRESS not in
(select swapper from tab1)then 'only gmx'
when ORIGIN_FROM_ADDRESS in(select swapper from tab1) and
ORIGIN_FROM_ADDRESS in(select swapper from tab2) then 'both' end as swapper_status
,count(distinct ORIGIN_FROM_ADDRESS) as swapper_count
from arbitrum.core.fact_event_logs
group by 1
Run a query to Download Data