freemartianTotal amAPT
    Updated 2024-05-08

    WITH

    withdraw AS(
    SELECT
    'withdraw' AS event,
    count(t.tx_hash) AS tx,
    count(DISTINCT sender) AS wallet,
    SUM(event_data:amount/pow(10,8)) AS 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
    GROUP BY 1
    ),

    mint AS(
    SELECT
    'mint' AS event,
    count(t.tx_hash) AS tx,
    count(DISTINCT sender) AS wallet,
    SUM(event_data:amapt/pow(10,8)) AS 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'
    GROUP BY 1
    )


    SELECT * FROM withdraw
    UNION
    SELECT * FROM mint

    ORDER BY 1 ASC
    Auto-refreshes every 1 hour
    QueryRunArchived: QueryRun has been archived