ciphersavantGetting Started
Updated 2024-07-13
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
›
⌄
-- 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
SELECT
token_address,
AVG(price) AS average_price,
MAX(price) AS max_price,
MIN(price) AS min_price,
COUNT(tx_hash) AS transaction_count
FROM
ethereum.core.ez_token_transfers AS transactions
JOIN
ethereum.price.ez_prices_hourly AS prices
ON
transactions.contract_address = prices.token_address -- Assuming tx_hash is the common key between tables
WHERE
token_address IN (
'0x6B175474E89094C44Da98b954EedeAC495271d0F', -- DAI
'0xA0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', -- USDC
'0xdAC17F958D2ee523a2206206994597C13D831ec7', -- USDT
'0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599', -- WBTC
'0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', -- WETH
'0x514910771AF9Ca656af840dff83E8264EcF986CA', -- LINK
'0x0D8775F648430679A709E98d2b0Cb6250d2887EF', -- BAT
'0x111111111117dC0aa78b770fA6A738034120C302', -- 1INCH
'0x408e41876cCCDC0F92210600ef50372656052a38', -- REN
'0x7D1AFA7B718fb893dB30A3aBc0Cfc608AaCfebb0' -- MATIC
)
GROUP BY
QueryRunArchived: QueryRun has been archived