pcwcfaEthereum_Core Table Walkthough: WBTC-WETH Pool on Sushiswap
Updated 2022-06-26
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
›
⌄
WITH pools AS (
SELECT
pool_name,
pool_address,
token0,
token1
FROM
ETHEREUM_CORE.DIM_DEX_LIQUIDITY_POOLS
WHERE
pool_address = LOWER('0xceff51756c56ceffca006cd410b03ffc46dd3a58') -- WBTC-WETH Sushiswap Pool address
),ethereum.core.fact_event_logsethereum.core.fact_event_logsethereum.core.fact_event_logs
-- get details for tokens in the relevant pool
decimals AS (
SELECT
address,
symbol,
decimals
FROM
ETHEREUM_CORE.DIM_CONTRACTS
WHERE
address = (
SELECT
LOWER(token1)
FROM
pools
)
OR address = (
SELECT
LOWER(token0)
FROM
pools
)
),
-- aggregate pool and token details
Run a query to Download Data