baymatUntitled Query
Updated 2023-02-12Copy Reference Fork
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 pools as(SELECT
pool_name,
pool_address,
token0,
token1
FROM ETHEREUM.CORE.DIM_DEX_LIQUIDITY_POOLS
WHERE pool_address = LOWER('0xceff51756c56ceffca006cd410b03ffc46dd3a58')
limit 10
),
get_token_details AS (SELECT
name,
symbol,
decimals
FROM ethereum.core.dim_contracts
where address= (
SELECT LOWER(token0)
FROM pools
)
or address = (
SELECT LOWER(token1)
FROM pools
)
),
-- getting the token details and pool details
token_details AS (SELECT
pool_name,
pool_address,
token0.symbol AS token0_symbol,
token1.symbol AS token1_symbol,
token0.decimals AS token0_decimals,
token1.decimals AS token1_decimals
FROM pools
LEFT JOIN get_token_details AS token0
ON token0 = token0
Run a query to Download Data