StangFAST07 - platforms copy
Updated 2023-09-27
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 07 - platforms @ https://flipsidecrypto.xyz/edit/queries/0060197c-76b6-495c-a429-12f4367c1e75
-- forked from 06 - swap volume @ https://flipsidecrypto.xyz/edit/queries/2862e90c-df66-4aff-b591-9b85007a4fce
with
price AS
(
SELECT
date_trunc( 'day' , a.recorded_hour ) AS date
, avg( a.close ) AS price
, a.symbol AS token
FROM
solana.price.ez_token_prices_hourly a
WHERE
a.token_address = 'BaoawH9p2J8yUK9r5YXQs3hQwmUJgscACjmTkh8rMwYL'
GROUP BY 1 , 3
ORDER BY 1 DESC
)
SELECT
date_trunc( 'day' , a.block_timestamp ) AS "date"
, count( DISTINCT a.swapper ) AS "user"
, count( DISTINCT a.tx_id ) AS "transaction"
, sum( a.swap_to_amount * b.price ) AS "usd volume"
, c.symbol AS "tokens"
FROM
solana.defi.fact_swaps a
JOIN
price b
ON a.block_timestamp::date = b.date
Run a query to Download Data