adriaparcerisasHave staking rewards impacted the amount of $RUNE bonded or in LPs?
Updated 2024-07-02
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
rune_in_pools as (
select
trunc(block_timestamp,'month') as date,
--distinct from_address as users,
sum(rune_amount_usd) as rune_deposited,
sum(rune_deposited) over (order by date) as total_rune_deposited
from thorchain.defi.fact_liquidity_actions
where lp_action = 'add_liquidity'
group by 1
),
rune_out_pools as (
select
trunc(block_timestamp,'month') as date,
--distinct from_address as users,
sum(rune_amount_usd) as rune_removed,
sum(rune_removed) over (order by date) as total_rune_removed
from thorchain.defi.fact_liquidity_actions
where lp_action = 'remove_liquidity'
group by 1
),
final_pools as (
SELECT
--x.users,
x.date,
total_rune_deposited-total_rune_removed as current_rune_lp
from rune_in_pools x
left join rune_out_pools y on x.date=y.date
--where x.users in (select users_adding from users)
--having current_lp_rune >0
),
srewards as (
SELECT
trunc(block_timestamp,'month') as date,
sum(liq_fee_rune_usd+liq_fee_asset_usd) as revenues,
QueryRunArchived: QueryRun has been archived