angealAvg Pre vs Post
Updated 2023-10-18
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
›
⌄
-- OP Bridge Contract '0x1d68124e65fafc907325e3edbf8c4d84499daa8b'
-- wormhole specifically wants to know what are users are doing before and after they use wormhole
-- (ie - what chains and apps were they / are they using, what actions were they taking, etc).
WITH wh_users AS (
SELECT
from_address,
min(block_timestamp) AS first_wh
FROM
optimism.core.fact_transactions
WHERE
to_address = '0x1d68124e65fafc907325e3edbf8c4d84499daa8b'
GROUP BY
from_address
),
-- get the wh users first transactions,
-- combine that info with the first wh txn
wh_users_2 AS (
SELECT
ft.from_address,
min(block_timestamp) AS first_op,
first_wh,
CASE
WHEN min(block_timestamp = first_wh) THEN 'y'
ELSE 'n'
END AS wh_is_first
FROM
optimism.core.fact_transactions ft
JOIN wh_users wh ON ft.from_address = wh.from_address
GROUP BY
ft.from_address,
first_wh
),
-- now get info on swaps
-- compare the prior 90 days activity
-- to the post 90 days
-- n swaps, swap volume, n tokens, n dexes
Run a query to Download Data