pandaSushi Query | Blockchain: Gnosis(Inflow)
Updated 2023-03-19
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 arbitrum_raw_sushi AS --Arbitrum stable coin activities
(
SELECT
BLOCK_TIMESTAMP,
TX_HASH,
AMOUNT_IN,
AMOUNT_OUT,
SYMBOL_IN,
SYMBOL_OUT
FROM
arbitrum.sushi.ez_swaps
WHERE
(POOL_NAME ilike '%USD%' OR POOL_NAME ilike '%DAI%') AND EVENT_NAME = 'Swap'
),
arbitrum_sushi AS
(
SELECT
'Arbitrum' as blockchain,
'Outflow' as swap_type,
BLOCK_TIMESTAMP,
TX_HASH,
CASE WHEN SYMBOL_IN = 'USDC' then 'USDC'
WHEN SYMBOL_IN = 'USDT' then 'USDT'
WHEN SYMBOL_IN = 'BUSD' then 'BUSD'
WHEN SYMBOL_IN = 'TUSD' then 'TUSD'
WHEN SYMBOL_IN = 'DAI' then 'DAI'
ELSE 'Others' END AS token_names,
AMOUNT_IN * -1 * b.price as volume
FROM
arbitrum_raw_sushi a JOIN ethereum.core.fact_hourly_token_prices b ON (a.BLOCK_TIMESTAMP::date = b.hour::date AND a.SYMBOL_IN = b.SYMBOL)
WHERE
token_names != 'Others'
UNION ALL