SocioAnalyticaoverview
Updated 2024-11-24
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
token_info as (
select
token_address,
symbol,
name,
decimals
from aptos.core.dim_tokens
)
,prices as (
select
hour,
symbol,
decimals,
token_address,
price
from aptos.price.ez_prices_hourly
)
, swaps as (
SELECT
a.block_timestamp,
a.block_number,
a.tx_hash,
a.event_index,
b.sender as swapper,
CASE
WHEN a.event_data:x_in :: int = 0 THEN TRIM(SPLIT(a.event_type, ',')[1] :: string, ' ')
WHEN a.event_data:x_in :: int != 0 THEN TRIM(SPLIT_PART(SPLIT(a.event_type, ',')[0], '<', 2) :: string, ' ')
END AS token_in,
CASE
WHEN a.event_data:y_in :: int = 0 THEN TRIM(SPLIT(a.event_type, ',')[1] :: string, ' ')
WHEN a.event_data:y_in :: int != 0 THEN TRIM(SPLIT_PART(SPLIT(a.event_type, ',')[0], '<', 2) :: string, ' ')
END AS token_out,
CASE
QueryRunArchived: QueryRun has been archived