freemartian--Bridge to aptos: user activity-total
Updated 2024-06-11
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 prices AS(
SELECT
hour::date AS price_day,
-- token_address AS price_token_address,
symbol AS price_symbol,
decimals,
AVG(price) AS token_price
FROM aptos.price.ez_hourly_token_prices
GROUP BY 1,2,3
ORDER BY 1 DESC
),
datas AS(
SELECT
block_timestamp,
tx_hash,
-- sender,
receiver,
source_chain_name,
destination_chain_name,
split_part(token_address,'::',3) AS symbol,
amount_unadj,
amount_unadj/pow(10,decimals) AS amount,
token_price * amount_unadj/pow(10,decimals) AS amount_usd
FROM aptos.defi.fact_bridge_activity b
INNER JOIN prices ON (price_day = block_timestamp::date AND price_symbol = symbol)
WHERE platform = 'layerzero'
AND direction = 'inbound'
AND (
sender IN (lower('{{EVM_Wallet}}'),lower('{{Aptos_Wallet}}'))
OR
receiver IN (lower('{{EVM_Wallet}}'),lower('{{Aptos_Wallet}}'))
)
)
Auto-refreshes every 1 hour
QueryRunArchived: QueryRun has been archived