cryptodatadiveWithdrawal Category
    Updated 2025-04-06
    WITH Withdraw_CTE AS (
    SELECT DISTINCT
    contract_name,
    contract_address,
    origin_from_address AS withdrawer,
    (decoded_log:assets::int) AS withdrawal_amount,
    tx_hash,
    date_trunc('day', block_timestamp) AS withdrawal_date
    FROM swell.core.ez_decoded_event_logs
    WHERE event_name = 'Withdraw'
    ),

    Withdrawal_CTE AS (
    SELECT DISTINCT
    contract_name,
    contract_address,
    origin_from_address AS withdrawer,
    (decoded_log:wad::int) AS withdrawal_amount,
    tx_hash,
    date_trunc('day', block_timestamp) AS withdrawal_date
    FROM swell.core.ez_decoded_event_logs
    WHERE event_name = 'Withdrawal'
    ),

    prices AS (
    SELECT
    LOWER(name) AS name,
    LOWER(symbol) AS symbol,
    date_trunc('day', hour) AS price_date,
    price,
    decimals
    FROM ethereum.price.ez_prices_hourly
    WHERE LOWER(symbol) IN ('swell', 'weth', 'usde', 'ena')
    ),

    Final_CTE AS (
    Last run: 21 days ago
    WITHDRAWAL_CATEGORY
    TOTAL_WITHDRAWERS
    TOTAL_TRANSACTIONS
    TOTAL_WITHDRAWALS_USD
    1
    Mega Whales(>100000)11801507915007827935439.4
    2
    Whales(10000-100000)32511667848.74221931
    3
    Sharks(1000-10000)91040072.935795748
    4
    Dolphins(500-1000)221683.791976604
    5
    Little Fish(100-500)22488.864743405
    5
    231B
    53s