Abbas_ra21most bridged token volume
Updated 2022-07-04Copy 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 bridged As (select
CASE
when TOKEN_CONTRACT ilike '%BloctoToken' then 'BLT'
when TOKEN_CONTRACT ilike '%RLY' then 'RLY'
when TOKEN_CONTRACT ilike '%REVV' then 'REVV'
when TOKEN_CONTRACT ilike '%StarlyToken' then 'STARLY'
when TOKEN_CONTRACT ilike '%lowToken' then 'FLOW'
when TOKEN_CONTRACT ilike '%ceAVAX' then 'AVAX'
when TOKEN_CONTRACT ilike '%ceBNB' then 'BNB'
when TOKEN_CONTRACT ilike '%ceBNB' then 'BNB'
when TOKEN_CONTRACT ilike '%ceBUSD' then 'BUSD'
when TOKEN_CONTRACT ilike '%ceUSDT' or TOKEN_CONTRACT ilike '%TeleportedTetherToken' then 'USDT'
when TOKEN_CONTRACT ilike '%ceWBTC' then 'WBTC'
when TOKEN_CONTRACT ilike '%ceFTM' then 'FRM'
when TOKEN_CONTRACT ilike '%ceWETH' then 'WETH'
when TOKEN_CONTRACT ilike '%ceMATIC' then 'MATIC'
else SUBSTR(TOKEN_CONTRACT, 20)
end as TOKEN,
sum(AMOUNT) AS amount
from flow.core.fact_bridge_transactions
group by 1),
prices AS (
SELECT DATE_TRUNC(DAY,TIMESTAMP) AS DAY,
SYMBOL AS TOKEN,
AVG(PRICE_USD) AS PRICE
FROM flow.core.fact_prices
GROUP BY 1,2
UNION ALL
SELECT DATE_TRUNC(DAY,HOUR) AS day,
SYMBOL AS TOKEN,
AVG(PRICE) AS PRICE
FROM ethereum.core.fact_hourly_token_prices where SYMBOL not in ('RLY','BLT','REVV','STARLY','FLOW')
GROUP BY 1,2
)
select
Run a query to Download Data