freemartianTotal User Activity
Updated 2024-04-25
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
withdraw AS(
SELECT
sender AS wallet,
'withdraw' AS event,
count(t.tx_hash) AS withdraw_transactions,
SUM(event_data:amount/pow(10,8)) AS withdraw_amount,
FROM aptos.core.fact_events e
INNER JOIN aptos.core.fact_transactions t ON (t.tx_hash = e.tx_hash)
WHERE event_type = '0x111ae3e5bc816a5e63c2da97d0aa3886519e0cd5e4b046659fa35796bd11542a::router::WithdrawalRequestEvent'
AND t.block_timestamp::date <= current_date - 30
AND sender = lower('{{wallet_address}}')
GROUP BY 1,2
),
mint AS(
SELECT
sender,
'mint' AS event,
count(t.tx_hash) AS mint_transactions,
SUM(event_data:amapt/pow(10,8)) AS mint_amount
FROM aptos.core.fact_events e
INNER JOIN aptos.core.fact_transactions t ON (t.tx_hash = e.tx_hash)
WHERE event_type = '0x111ae3e5bc816a5e63c2da97d0aa3886519e0cd5e4b046659fa35796bd11542a::router::MintEvent'
AND sender = lower('{{wallet_address}}')
GROUP BY 1,2
)
SELECT
mint_transactions, mint_amount,
withdraw_transactions, withdraw_amount
FROM mint, withdraw
QueryRunArchived: QueryRun has been archived