freemartianDune Guide
    with daily as
    (
    select
    date_trunc('day', block_time) as day,
    CASE
    WHEN `product_id` = '1' then 'ETH-USD'
    WHEN `product_id` = '2' then 'BTC-USD'
    WHEN `product_id` = '3' then 'SOL-USD'
    WHEN `product_id` = '4' then 'MATIC-USD'
    WHEN `product_id` = '5' then 'AVAX-USD'
    WHEN `product_id` = '6' then 'LINK-USD'
    WHEN `product_id` = '7' then 'SNX-USD'
    WHEN `product_id` = '8' then 'AAVE-USD'
    WHEN `product_id` = '9' then 'APE-USD'
    WHEN `product_id` = '10' then 'AXS-USD'
    WHEN `product_id` = '11' then 'UNI-USD'
    WHEN `product_id` = '12' then 'OP-USD'
    WHEN `product_id` = '13' then 'DOGE-USD'
    WHEN `product_id` = '14' then 'CRV-USD'
    WHEN `product_id` = '15' then 'NEAR-USD'
    WHEN `product_id` = '16' then 'ATOM-USD'
    WHEN `product_id` = '17' then 'EUR-USD'
    WHEN `product_id` = '18' then 'JPY-USD'
    WHEN `product_id` = '19' then 'GBP-USD'
    WHEN `product_id` = '20' then 'AUD-USD'
    WHEN `product_id` = '21' then 'CAD-USD'
    WHEN `product_id` = '22' then 'BNB-USD'
    WHEN `product_id` = '23' then 'DYDX-USD'
    WHEN `product_id` = '24' then 'FTM-USD'
    WHEN `product_id` = '25' then 'SAND-USD'
    else 'Other' end as `Pair`,
    sum(`margin` * `leverage`) as `volume`,
    count (DISTINCT `user`) as `users`

    from (
    WITH open_orders_v3 AS (
    Run a query to Download Data