gp24ETH trader 2 copy
Updated 2023-05-03Copy 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
32
33
34
35
36
›
⌄
-- forked from mattkstew / ETH trader 2 @ https://flipsidecrypto.xyz/mattkstew/q/2023-04-04-09-50-pm-lxqZRW
with tab1 as (
select
block_timestamp,
seller_address,
project_name,
tokenid,
price_usd as Sell_price
from ethereum.core.ez_nft_sales
where block_timestamp > current_date - 365
)
, tab2 as (
select
block_timestamp,
buyer_address,
project_name,
tokenid,
price_usd as Buy_price
from ethereum.core.ez_nft_sales
where block_timestamp > current_date - 90
)
, tab3 as (
select
tab1.block_timestamp as date1,
buyer_address as User,
--project_name,
sell_price - buy_price as Net_profit
from tab1 left outer join tab2 on
seller_address = buyer_address and
tab1.tokenid = tab2.tokenid and tab1.project_name = tab2.project_name
Run a query to Download Data