theericstoneEthereum - Deposits and Withdrawals to OKEx
Updated 2022-01-24
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
›
⌄
WITH deposits AS
( SELECT date_trunc('day',block_timestamp) AS day,
symbol,
sum(amount_usd) AS usd_in
FROM gold.ethereum_events
WHERE to_label_subtype = 'distributor_cex_satellite'
AND to_label = 'okex'
AND block_timestamp > '2020-10-01'
AND symbol = 'ETH'
GROUP BY 1,
2),
withdrawals AS
( SELECT date_trunc('day',block_timestamp) AS day,
symbol,
sum(amount_usd) AS usd_out
FROM gold.ethereum_events
WHERE from_label_subtype = 'distributor_cex'
AND to_label_type <> 'distributor'
AND from_label = 'okex'
AND block_timestamp > '2020-10-01'
AND symbol = 'ETH'
GROUP BY 1,
2)
SELECT deposits.day,
deposits.symbol,
usd_in,
usd_out
FROM deposits
JOIN withdrawals
ON deposits.day = withdrawals.day
ORDER BY deposits.day;
Run a query to Download Data