rw2023ETH Foundation - EthDev Wallet History
Updated 2024-09-16Copy Reference Fork
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
›
⌄
-- forked from DataFi / EthDev Wallet History @ https://flipsidecrypto.xyz/DataFi/q/UPnnlXctR1oy/ethdev-wallet-history
WITH tx_out AS (
SELECT
date_trunc('day', block_timestamp) AS time,
value AS value1,
tx_hash as tx
FROM ethereum.core.fact_traces
WHERE from_address = lower('0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe')
-- AND block_timestamp > date('2020-12-01')
),
price AS (
SELECT
date_trunc('day', hour) AS time,
AVG(price) AS price
FROM crosschain.price.ez_prices_hourly
WHERE symbol = 'ETH'
AND date_trunc('day', hour) > date('2018-12-01')
GROUP BY 1
)
SELECT
p.time,
p.price,
sum(t.value1) AS value_out
FROM price p
LEFT JOIN tx_out t ON p.time = t.time
group by 1,2
ORDER BY p.time
QueryRunArchived: QueryRun has been archived