0x97a93E68f2f8d99A69a95e7a8b683561410a1ac3smart trader check (2.2) - Dex Buy/Sell Table copy
Updated 2023-02-11
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
›
⌄
-- forked from 3af3f9c1-a58f-4023-92e7-77c3a34df22d
with smart_trader as (select '{{address}}' as address),
-- smart_trader_balance as
-- (select
-- max(block_timestamp) over() as max_timestamp,
-- block_timestamp,
-- s.address,
-- contract_address,
-- symbol,
-- token_name,
-- current_bal,
-- current_bal_usd,
-- bal_delta,
-- bal_delta_usd
-- from ethereum.core.ez_balance_deltas b
-- inner join smart_dex_trader s
-- on b.user_address = s.address
-- and block_timestamp >= current_date - interval '7 days')
-- select
-- address,
-- symbol,
-- count(distinct address) as no_smart_trader,
-- sum(current_bal) as total_token_balance,
-- sum(current_bal_usd) as total_token_balance_usd,
-- sum(bal_delta) as net_bal_delta,
-- sum(bal_delta_usd) as net_bal_delta_usd
-- from smart_trader_balance
-- where block_timestamp = max_timestamp
-- group by 1,2
-- order by 3 desc
tx_agg as
(SELECT
tx.block_timestamp,
Run a query to Download Data