theericstoneexchange deposits
Updated 2020-12-02
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
›
⌄
SELECT
deposits.date,
deposits.total_deposits_algo,
deposits.total_deposits_algo * price.close as total_deposits_usd,
deposits.n_depositors
FROM
(
SELECT
date_trunc('day',udm.block_timestamp) as date,
sum(event_amount / (10^6)) as total_deposits_algo,
count( distinct udm.event_from) as n_depositors
FROM
public.udm_events_algorand udm
JOIN public.udm_address_labels labto
ON udm.event_to = labto.address
WHERE
udm.block_timestamp > getdate() - INTERVAL '2 months'
AND udm.event_currency = 'ALGO'
AND labto.project_name = 'binance'
AND labto.l2_label = 'distributor_cex_satellite' -- eliminates sweeps and intra-exchange moves
GROUP BY date
ORDER BY date
) deposits
JOIN public.daily_candles price
ON date_trunc('day',price.recorded_at) + 1 = deposits.date
WHERE price.symbol = 'ALGO'
ORDER BY deposits.date DESC;
Run a query to Download Data