nitsUSDC swapper top 10 Profits made
Updated 2022-03-30
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
›
⌄
with swap_from_usdc as
(SELECT swapper ,swap_from_amount , block_timestamp, row_number() over (partition by swapper order by block_timestamp) as rn from algorand.swaps
where swap_from_asset_id = '31566704' and block_timestamp >= '2022-01-01'),
swap_to_usdc as
(SELECT swapper as s ,swap_to_amount as s_to_amt, block_timestamp as bt, row_number() over (partition by swapper order by block_timestamp) as rn1 from algorand.swaps
where swap_to_asset_id = '31566704' and block_timestamp >= '2022-01-01' )
SELECT swapper, sum(max_profit)-sum(swap_from_amount) as total_profit from
(SELECT
swapper, block_timestamp, swap_from_amount,max(s_to_amt) as max_profit
from
(SELECT *
from swap_from_usdc
inner join swap_to_usdc
on s =swapper )
where timestampdiff(SQL_TSI_SECOND, bt, block_timestamp)<= 60
and s_to_amt > swap_from_amount and s_to_amt< 1.2*swap_from_amount and s_to_amt> 0.8*swap_from_amount
GROUP by 1,2,3 )
GROUP by 1
order by total_profit desc
limit 10
Run a query to Download Data