yusyusGetting Started
Updated 2025-01-06Copy 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
›
⌄
-- Get started with Flipside by running your first query:
-- the SQL statement below will get you a list of NFT
-- platforms on Ethereum, ranked by how many sales
-- they've had in the past month.
-- Be sure to see our documentation for more guidance,
-- including a full walkthrough of the app:
-- https://docs.flipsidecrypto.xyz/our-app/getting-started
with uniswap AS
(select origin_from_address, tx_hash
--platform,
--count(tx_hash) as n_swaps
FROM ethereum.defi.ez_dex_swaps
where block_timestamp :: DATE >= current_date - 31
AND
platform in ('uniswap-v2', 'uniswap-v3')
--group by 1
)
SELECT uniswap.origin_from_address as user,
count(DISTINCT uniswap.tx_hash) as n_swaps,
count(DISTINCT nft.tx_hash) as nft_purchases
FROM uniswap
JOIN ethereum.nft.ez_nft_sales nft
ON uniswap.origin_from_address = nft.buyer_address
WHERE nft.block_timestamp :: DATE >= current_date - 31
GROUP by 1
ORDER by 3 DESC
QueryRunArchived: QueryRun has been archived