datavortexNew vs existing Wallets (Bridge to new )
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
26
27
28
29
30
31
32
33
34
35
36
›
⌄
WITH first_bridge AS (
SELECT
destination_address,
MIN(block_timestamp) AS "First Bridge Timestamp"
FROM
near.defi.ez_bridge_activity
WHERE
LOWER(destination_chain) = 'near'
GROUP BY
destination_address
),
last_year_bridges AS (
SELECT
tx_hash,
destination_address,
amount_usd,
block_timestamp
FROM
near.defi.ez_bridge_activity
WHERE
LOWER(destination_chain) = 'near'
AND block_timestamp BETWEEN CURRENT_TIMESTAMP - INTERVAL '1 year' AND CURRENT_TIMESTAMP
)
SELECT
'New Wallets' AS "Category",
COUNT(DISTINCT lb.destination_address) AS "Wallet Count",
SUM(COALESCE(lb.amount_usd, 0)) AS "Volume"
FROM
last_year_bridges lb
LEFT JOIN
first_bridge fb
ON
lb.destination_address = fb.destination_address
QueryRunArchived: QueryRun has been archived