StangFAST03 - pool
Updated 2023-08-12
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 02 - swap token @ https://flipsidecrypto.xyz/edit/queries/02b34085-2c1b-4ee1-913f-d47bcb7d67e1
-- forked from 01 - swap overview - chart @ https://flipsidecrypto.xyz/edit/queries/5e2ae921-9f48-415f-8d2d-9823c9f595af
with
chikn AS
(
SELECT
date_trunc( 'day' , a.hour ) AS "day"
, avg( a.price ) AS "price"
, a.symbol AS "token"
, a.token_address AS "token_address"
, a.decimals AS "decimals"
FROM
avalanche.core.fact_hourly_token_prices AS a
WHERE
a.token_address IN (
lower( '0x79BA10485ae46a9436D560D9664369176EC2eB2b' )
, lower( '0xab592d197ACc575D16C3346f4EB70C703F308D1E' )
, lower( '0x9C846D808A41328A209e235B5e3c4E626DAb169E' )
, lower( '0x7761E2338B35bCEB6BdA6ce477EF012bde7aE611' )
)
AND "day" <= dateadd( 'day' , -1 , current_date )
GROUP BY 1 , 3 , 4 , 5
ORDER BY 1 DESC
)
SELECT
date_trunc( '{{period}}' , a.block_timestamp ) AS "date"
, count( DISTINCT a.origin_from_address ) AS "users"
, count( DISTINCT a.tx_hash ) AS "transaction"
, sum( a.amount_in * b."price" ) AS "usd volume"
, a.pool_name AS "pools"
Run a query to Download Data