intensodefiAddress Tagging - Arbitrage bot addresses
Updated 2021-12-24Copy 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
›
⌄
WITH arbitrage_chances as (select
block_id,
block_timestamp,
pool_name,
(rune_usd / price_asset_rune)- asset_usd as different_amount
from
thorchain.prices
where
(rune_usd / price_asset_rune)- asset_usd > 0.1),
num_of_swaps as(
SELECT from_address,count(distinct tx_id) as number_of_swaps FROM thorchain.swaps
-- where block_timestamp >= current_date - interval '30 day'
group by from_address
--order by number_of_swaps desc
),
vol_of_swaps as (
SELECT from_address,sum(to_amount_usd) as volume_of_swaps FROM thorchain.swaps
-- where block_timestamp >= current_date - interval '30 day'
group by from_address
)
select distinct from_address from thorchain.swaps
where block_id in (select block_id from arbitrage_chances) AND from_address in (select from_address from num_of_swaps WHERE number_of_swaps >1000)
and from_address in (select from_address from vol_of_swaps WHERE volume_of_swaps >10000)
Run a query to Download Data