datavortexFlow
Updated 2024-11-18
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
›
⌄
SELECT
CONCAT(
COALESCE(source_chain, 'Unknown'),
' → ',
COALESCE(destination_chain, 'Unknown')
) AS flow_direction,
COALESCE(SUM(amount_usd), 0) AS total_volume,
COUNT(DISTINCT tx_hash) AS total_bridges,
CASE
WHEN LOWER(source_chain) = 'near' THEN 'Outflow'
WHEN LOWER(destination_chain) = 'near' THEN 'Inflow'
ELSE 'Other'
END AS flow_type
FROM
near.defi.ez_bridge_activity
WHERE
block_timestamp BETWEEN '2023-01-01' AND '2024-12-31'
GROUP BY
flow_direction, flow_type
HAVING
total_volume > 0
AND flow_type IN ('Inflow', 'Outflow')
ORDER BY
total_volume DESC
LIMIT 10;
QueryRunArchived: QueryRun has been archived