0xHaM-dDaily top 10 Paraswap Tx count
Updated 2022-11-27Copy Reference Fork
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
›
⌄
with avatokens as (
select
distinct token_in,
symbol_in
from avalanche.sushi.ez_swaps
),
maintable as (
select
block_timestamp::date as date,
contract_address,
symbol_in,
count (distinct tx_hash) as Swaps_Count,
count (distinct origin_from_address) as Swappers_Count
from avalanche.core.fact_event_logs t1 join avatokens t2 on t1.contract_address = t2.token_in
where origin_to_address = lower('0xdef171fe48cf0115b1d80b88dc8eab59176fee57')
and event_name = 'Transfer'
and tx_status = 'SUCCESS'
and block_timestamp >= CURRENT_DATE - 30
and block_timestamp <= CURRENT_DATE - 1
and event_inputs:from = origin_from_address
--and contract_address in (select token_in from avatokens)
group by 1,2,3
),
finaltable as (
select *,
row_number() over (partition by date order by Swaps_Count desc) as RN
from maintable
)
select * from finaltable
where RN <= 10
order by date
Run a query to Download Data