cloudr3nCapybara DEX Swap Volume
Updated 2024-10-02
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
pools AS (
-- Get data from target query
SELECT
value:POOL_ADDRESS::string AS pool_address
FROM (
SELECT
livequery.live.udf_api('https://flipsidecrypto.xyz/api/v1/queries/15ad3389-f2bc-4806-be2d-c93f507480d1/data/latest') as response
), lateral FLATTEN (input => response:data)
),
swap_base as (
select
block_number,
block_timestamp,
tx_hash,
origin_function_signature,
origin_from_address,
origin_to_address,
event_index,
contract_address,
regexp_substr_all(SUBSTR(data, 3, len(data)), '.{64}') AS l_segmented_data,
CONCAT('0x', SUBSTR(l.topics [1] :: STRING, 27, 40)) AS sender_address,
CONCAT('0x', SUBSTR(l.topics [2] :: STRING, 27, 40)) AS to_address,
CONCAT(
'0x',
SUBSTR(
l_segmented_data [0] :: STRING,
25,
40
)
) AS fromToken,
CONCAT(
'0x',
SUBSTR(
l_segmented_data [1] :: STRING,
QueryRunArchived: QueryRun has been archived