Abbas_ra21Withdraw Volume by Symbol daily
    Updated 2024-12-12
    -- forked from Deposit Volume by Symbol daily @ https://flipsidecrypto.xyz/studio/queries/49848140-6eaa-42eb-b5ce-4d75d5665b29

    -- forked from Volume,TX,users by Action daily @ https://flipsidecrypto.xyz/studio/queries/2cd15e9a-7de3-4151-bb44-d66bae166cd9
    with ETH_prices AS (
    select
    *
    from
    crosschain.price.ez_prices_hourly
    where
    token_address in ('0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2')
    ),
    sol_prices AS (
    select
    *
    from
    crosschain.price.ez_prices_hourly
    where
    token_address in ('So11111111111111111111111111111111111111112')
    ),
    tb AS (
    select
    block_timestamp,
    TX_ID,
    SIGNERS [0] AS User,
    case
    when EVENT_TYPE = 'mintTo' then 'Deposit'
    when EVENT_TYPE = 'burn' then 'Withdraw'
    when EVENT_TYPE = 'burnChecked' then 'Borrow'
    when EVENT_TYPE = 'mintToChecked' then 'Repay'
    end AS Action,
    case
    when INSTRUCTION:parsed:info:mint = 'AbefESHCRKZKQbdcAD8qes4EjzQfzMN1KkCCMsz7TogL'
    and EVENT_TYPE in ('mintTo', 'burn')
    or (
    INSTRUCTION:parsed:info:mint = 'So11111111111111111111111111111111111111112'
    and EVENT_TYPE in ('burnChecked', 'mintToChecked')
    QueryRunArchived: QueryRun has been archived