AshlyCryptoLiFi Bridge
Updated 2023-04-22
999
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
›
⌄
with
priceTb1 as (
SELECT
date_trunc('day', hour) as p_date,
TOKEN_ADDRESS,
DECIMALS,
avg(price) as price
FROM
polygon.core.fact_hourly_token_prices
GROUP by
1,
2,
3
),
priceTb2 as (
SELECT
date_trunc('day', hour) as p_date,
symbol,
avg(price) as price
FROM
ethereum.core.fact_hourly_token_prices
GROUP by
1,
2
)
SELECT
date_trunc('day', block_timestamp) as date,
'Polygon' as chain,
count(DISTINCT tx_hash) as tx_cnt,
count(DISTINCT origin_from_address) as usr_cnt,
sum(price * (raw_amount / pow(10, DECIMALS))) as volume,
sum(tx_cnt) over (
order by
date
) as cum_tx_cnt,
sum(Volume) over (
Run a query to Download Data