freemartianUser activity
Updated 2024-12-08
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 day,
symbol,
AVG(price) AS price
FROM aptos.price.ez_prices_hourly
GROUP BY 1,2
),
supply AS (
SELECT
block_timestamp,
tx_hash,
event_data:account_addr AS wallet,
tokens.symbol,
event_data:amount/pow(10,decimals) AS amount,
(event_data:amount/pow(10,decimals))*price AS amount_usd
FROM aptos.core.fact_events ev
JOIN aptos.core.fact_transfers trans using(TX_HASH)
JOIN aptos.core.dim_tokens tokens using(TOKEN_ADDRESS)
INNER JOIN prices p ON (block_timestamp::date = day AND p.symbol = tokens.symbol)
WHERE event_type = '0xc6bc659f1649553c1a3fa05d9727433dc03843baac29473c817d06d39e7621ba::lending::SupplyEvent'
AND wallet = LOWER ('{{wallet_address}}')
GROUP BY all
),
withdraw AS (
SELECT
block_timestamp,
tx_hash,
event_data:account_addr AS wallet,
tokens.symbol,
event_data:amount/pow(10,decimals) AS amount,
(event_data:amount/pow(10,decimals))*price AS amount_usd
FROM aptos.core.fact_events ev
Auto-refreshes every 1 hour
QueryRunArchived: QueryRun has been archived