0xbipool_dim
Updated 2023-05-27
999
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
›
⌄
wwith eth_price as
(
SELECT
'join_key' as join_key
,LATEST_ANSWER_UNADJ /1E8 as eth_price
from ethereum.chainlink.ez_oracle_feeds
-- where BLOCK_TIMESTAMP>'2023-01-01'
where FEED_NAME ='ETH / USD'
order by 1 desc
limit 1
),
pool_info as
(
SELECT
*
from
(
SELECT
pair_type
,POOL_ADDRESS
,POOL_NAME
,TOKEN0
,TOKEN0_SYMBOL
,TOKEN1
,TOKEN1_SYMBOL
,b_USD_VALUE_NOW
,c_USD_VALUE_NOW
,b_CURRENT_BAL
,c_CURRENT_BAL
,case
when b_CONTRACT_ADDRESS is null and c_CONTRACT_ADDRESS is null then 'Unused Pool'
when USD_AMOUNT<2000 then 'Tiny Pool'
when USD_AMOUNT is null then 'Null Pool'
else 'Other'
end as pool_type
Run a query to Download Data