binhachon48. DOGE-RUNE LP-ers - Withdrew liquidity or not?
Updated 2022-01-29
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
›
⌄
-- Find list of addresses that added liquidity to doge pool
with address_list as (
select
distinct from_address as liquidity_provider
from thorchain.liquidity_actions
where pool_name = 'DOGE.DOGE'
and lp_action = 'add_liquidity'
),
-- Find the timestamp of the first transactions, since we only need to find whether these addresses have any transaction before 15th Jan, return only the address will be sufficient in this case.
-- There is no need to find the first date
first_transactions as (
select
distinct from_address
from thorchain.swaps
where from_address in (select liquidity_provider from address_list)
and block_timestamp < '2022-01-15 00:00:00'
union -- UNION combines with duplicate elimination.
select
distinct to_address
from thorchain.swaps
where to_address in (select liquidity_provider from address_list)
and block_timestamp < '2022-01-15 00:00:00'
union
select
distinct from_address
from thorchain.transfers
where from_address in (select liquidity_provider from address_list)
and block_timestamp < '2022-01-15 00:00:00'
union
select
Run a query to Download Data