0xHaM-dAll-Time Low
Updated 2024-10-26
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
›
⌄
-- forked from All-Time High @ https://flipsidecrypto.xyz/edit/queries/032cb881-9208-431d-a9cc-27ce19a78eac
-- forked from Daily Price Changes @ https://flipsidecrypto.xyz/edit/queries/faefa224-8ec3-4304-aece-a6cbca9eee31
with
token_info as (
select
token_address,
symbol,
name,
decimals
from aptos.core.dim_tokens
)
,prices as (
select
hour as p_date,
symbol,
decimals,
token_address,
avg(price) as avg_price
from aptos.price.ez_prices_hourly
GROUP by 1, 2, 3, 4
)
, swaps as (
SELECT
BLOCK_TIMESTAMP,
TX_HASH,
EVENT_DATA,
EVENT_TYPE,
sender as swapper,
CASE
WHEN event_data:x_in :: int = 0 THEN TRIM(SPLIT_PART(SPLIT(event_type, ',')[1], ' ',2) :: string, '>')
WHEN event_data:x_in :: int != 0 THEN TRIM(SPLIT_PART(SPLIT(event_type, ',')[0], '<', 2) :: string, ' ')
END AS token_in,
CASE
WHEN event_data:y_in :: int = 0 THEN TRIM(SPLIT_PART(SPLIT(event_type, ',')[1], ' ',2) :: string, '>')
Auto-refreshes every 1 hour
QueryRunArchived: QueryRun has been archived