SandeshCEX inflows + outflow
Updated 2024-10-10
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
›
⌄
⌄
-- forked from Binance CEX inflows + outflow @ https://flipsidecrypto.xyz/studio/queries/f12c1fcb-a604-468c-adf7-700ac6c84dbb
/*
This query analyzes Binance's arbitrum wallet activity, focusing on deposits and withdrawals.
It identifies transactions between Binance's labeled addresses and external addresses,
then aggregates the daily volume for each action type (deposit or withdrawal).
Key features:
1. Separates withdrawals and deposits into distinct CTEs
2. Uses label information to identify Binance-related addresses
3. Excludes internal transfers between Binance's own addresses
4. Combines withdrawal and deposit data
5. Aggregates daily volume by action type
*/
-- CTE for withdrawal transactions from Binance hot wallets to external addresses
with arb as
(
WITH withdrawals AS (
with transactions as (
SELECT
ent.tx_hash
, ent.block_timestamp
, -1 * ent.amount AS amount -- Negative amount to represent outflow
, ent.to_address
, 'withdraw' AS action
, dl.project_name as cex
, ent.to_address as user
FROM
arbitrum.core.ez_token_transfers ent
INNER JOIN
arbitrum.core.dim_labels dl
ON ent.from_address = dl.address
LEFT JOIN
arbitrum.core.dim_labels dl_to_address
ON ent.to_address = dl_to_address.address
QueryRunArchived: QueryRun has been archived