binhachon24. [Easy] Unique Addresses - Total
Updated 2021-11-19
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
›
⌄
with all_deposit as(
select origin_address, tx_id, block_timestamp, row_number() over (partition by origin_address order by block_timestamp asc) as row_number from ethereum.udm_events
where tx_id in (
select distinct tx_id from aave.deposits
where date_trunc('Week', block_timestamp) > getdate() - interval'12 months'
and date_trunc('Week', block_timestamp) < getdate() - interval'2 days'
)
),
first_deposit as(
select origin_address, tx_id, block_timestamp from all_deposit
where row_number = 1
),
all_borrow as(
select origin_address, tx_id, block_timestamp, row_number() over (partition by origin_address order by block_timestamp asc) as row_number from ethereum.udm_events
where tx_id in (
select distinct tx_id from aave.borrows
where date_trunc('Week', block_timestamp) > getdate() - interval'12 months'
and date_trunc('Week', block_timestamp) < getdate() - interval'2 days'
)
),
first_borrow as(
select origin_address, tx_id, block_timestamp from all_borrow
where row_number = 1
),
all_flashloan as(
select origin_address, tx_id, block_timestamp, row_number() over (partition by origin_address order by block_timestamp asc) as row_number from ethereum.udm_events
where tx_id in (
select distinct tx_id from aave.flashloans
where date_trunc('Week', block_timestamp) > getdate() - interval'12 months'
and date_trunc('Week', block_timestamp) < getdate() - interval'2 days'
)
),
first_flashloan as(
select origin_address, tx_id, block_timestamp from all_flashloan
where row_number = 1
)
Run a query to Download Data