datavortexsample results
Updated 2025-04-28
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
›
⌄
WITH swap_events AS (
SELECT
tx_hash,
origin_to_address AS pool_address,
block_timestamp
FROM
ink.core.ez_decoded_event_logs
WHERE
event_name = 'Swap'
AND origin_to_address = '0xa8c1c38ff57428e5c3a34e0899be5cb385476507'
AND block_timestamp IS NOT NULL
AND tx_succeeded = TRUE
),
token_transfers AS (
SELECT
tx_hash,
contract_address,
symbol,
amount_usd
FROM
ink.core.ez_token_transfers
),
amounts_with_index AS (
SELECT
t1.tx_hash,
t1.contract_address,
t1.symbol,
t1.amount_usd,
MAX(CASE WHEN LOWER(t2.symbol) = 'weth' THEN t2.amount_usd END)
OVER (PARTITION BY t1.tx_hash) AS weth_amount_usd,
ROW_NUMBER() OVER (PARTITION BY t1.tx_hash ORDER BY LOWER(t1.symbol) ASC) AS symbol_index
FROM
token_transfers t1
LEFT JOIN