banbannardNew User Onboarding 4
Updated 2022-06-28Copy 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
33
34
35
36
›
⌄
with base as (select native_to_address as address, block_timestamp, 'Swap to RUNE' as methods
from thorchain.swaps where address ilike 'thor%' and to_asset = 'THOR.RUNE'
union
--2
select from_address as address, block_timestamp, 'Remove Liquidity'
from thorchain.liquidity_actions where address ilike 'thor%' and lp_action = 'remove_liquidity' and rune_amount > 0
union
--3
select to_address as address, block_timestamp, 'Transfer From CEX'
from thorchain.transfers where address ilike 'thor%' and from_address in ('thor1ty6h2ll07fqfzumphp6kq3hm4ps28xlm2l6kd6', 'thor1t60f02r8jvzjrhtnjgfj4ne6rs5wjnejwmj7fh', 'thor1uz4fpyd5f5d6p9pzk8lxyj4qxnwq6f9utg0e7k', 'thor179wpxmm5f7asaqwfwnnf8sn3rductlq3ywmrl0')
union
select to_address as address, block_timestamp, 'Direct Transfers'
from thorchain.transfers where address ilike 'thor%' and from_address not in ('thor1ty6h2ll07fqfzumphp6kq3hm4ps28xlm2l6kd6', 'thor1t60f02r8jvzjrhtnjgfj4ne6rs5wjnejwmj7fh', 'thor1uz4fpyd5f5d6p9pzk8lxyj4qxnwq6f9utg0e7k', 'thor179wpxmm5f7asaqwfwnnf8sn3rductlq3ywmrl0')
union
--4
select to_address as address, block_timestamp, 'RUNE Upgrade'
from thorchain.upgrades where address ilike 'thor%'),
base2 as (select address,
min(block_timestamp) as first_RUNE_receipt
from base
group by 1),
base3 as (select a.address,
block_timestamp as first_RUNE_receipt,
methods
from base a
join base2 b
on a.address = b.address and a.block_timestamp = b.first_RUNE_receipt
where methods = 'Transfer From CEX'),
base4 as (select from_address,
address_name,
a.to_address,
first_RUNE_receipt,
1 as numbering
Run a query to Download Data