maybeyonasthorchain_lp_start_daily
Updated 2021-12-18
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 current_providers as (
select * from (
select
from_address as user,
pool_name,
-- lp_action,
sum(
case
when lp_action = 'add_liquidity'
then stake_units
when lp_action = 'remove_liquidity'
then -stake_units
end
) as net_stake_units
from thorchain.liquidity_actions
-- where lp_action = 'add_liquidity'
group by 1,2
)
where
net_stake_units > 0
and user is not null
),
first_lping as (
select
from_address as user,
pool_name,
min(block_timestamp) as first_lp
from thorchain.liquidity_actions
where lp_action = 'add_liquidity'
group by 1,2
),
first_of_current as (
select
c.user,
c.pool_name,
first_lp
Run a query to Download Data