pepperatziGeneral Markets Review
    Updated 2025-02-14
    --contract usdc: 0xb1fdc3f660b0953253141b2509c43014d5d3d733
    -- mint: same as deposit,
    -- transfer / reedem: same as withdrawal

    /*combined as (
    select * from core_deposit
    union
    select * from core_withdrawn
    union
    select * from core_borrow
    )
    */

    with usdc_market as (
    SELECT
    block_timestamp,
    tx_hash,
    event_name,
    decoded_log
    from core.core.ez_decoded_event_logs
    where contract_address = '0xb1fdc3f660b0953253141b2509c43014d5d3d733'
    and event_name in ('Redeem', 'Mint', 'Borrow')
    and topics[0] in ('0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef',
    '0x4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f',
    '0x13ed6866d4e1ee6da46f845c46d7e54120883d75c5ea9a2dacc1c4ca8984ab80',
    '0xe5b754fb1abb7f01b499791d0b820ae3b6af3424ac1c59768edb53f4ec31a929')
    ),

    usdc_withdrawn as (
    SELECT
    block_timestamp,
    tx_hash,
    'USDC' as market,
    'withdrawn' as event,
    decoded_log:redeemer::string as user,
    decoded_log:redeemTokens::int / 1e6 as amount
    QueryRunArchived: QueryRun has been archived