freemartianRecent Top Wallets History
Updated 2022-10-26
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 price AS (
SELECT recorded_at::DATE AS price_day,
project_name,
address,
avg(price) AS pricedaily
FROM osmosis.core.dim_prices INNER JOIN osmosis.core.dim_labels
ON project_name = symbol
GROUP BY 1,2,3
),
add as (
select
LIQUIDITY_PROVIDER_ADDRESS as LP_add,
SUM(amount/pow(10, decimal)*pricedaily) AS join_amount
from osmosis.core.fact_liquidity_provider_actions
inner join price on address = currency and block_timestamp::date = price_day
where pool_id in ('1', '678', '704', '712', '722', '803', '674', '497', '9', '604',
'812', '498', '2', '584', '611', '3', '481', '585', '773', '10')
and action = 'pool_joined'
group by 1
),
remove as (
select
LIQUIDITY_PROVIDER_ADDRESS as LP_remove,
SUM(amount/pow(10, decimal)*pricedaily) AS remove_amount
from osmosis.core.fact_liquidity_provider_actions
inner join price on address = currency and block_timestamp::date = price_day
where pool_id in ('1', '678', '704', '712', '722', '803', '674', '497', '9', '604',
'812', '498', '2', '584', '611', '3', '481', '585', '773', '10')
and action = 'pool_exited'
group by 1
),
top_wallets as (
select LP_add, join_amount - remove_amount as Liquidity
from add inner join remove on LP_add = LP_remove
where liquidity is not null
Run a query to Download Data