rezarwzvolume and bets
    Updated 2025-02-26
    with all_bets as (
    SELECT
    ev.tx_hash as tx_hash,
    ev.block_Timestamp as block_Timestamp,
    DECODED_LOG:fee,
    DECODED_LOG:maker,
    DECODED_LOG:makerAmountFilled / pow(10, 18) as maker_amount,
    DECODED_LOG:makerAssetId,
    DECODED_LOG:taker,
    DECODED_LOG:takerAmountFilled / pow(10, 18) as taker_amount,
    DECODED_LOG:takerAssetId,
    CASE
    WHEN decoded_log:takerAssetId = 0 then decoded_log:takerAmountFilled
    when decoded_log:makerAssetId = 0 then decoded_log:makerAmountFilled
    end / 1e18 as Amount_USD,
    CASE
    WHEN decoded_log:takerAssetId = 0 then decoded_log:makerAssetId
    when decoded_log:makerAssetId = 0 then decoded_log:takerAssetId
    end as assets_id
    FROM
    blast.core.ez_decoded_event_logs ev
    where
    ev.contract_address in(
    '0x739f0331594029064c252559436edce0e468e37a',
    '0x6a3796c21e733a3016bc0ba41edf763016247e72'
    )
    and event_name = 'OrderFilled'
    )
    SELECT
    sum(Amount_USD) as "USD volume",
    count(tx_hash) as "# of Bets",
    (SELECT avg(volume) from (SELECT block_Timestamp::date,sum(Amount_USD) as volume from all_bets GROUP by 1)) as "Daily Avg Volume"
    FROM
    all_bets
    Last run: about 2 months ago
    USD volume
    # of Bets
    Daily Avg Volume
    1
    96005446.2433803272160539356.439569552
    1
    44B
    9s