MLDZMNTotal fee- new based on instructions
    Updated 2024-07-03
    -- forked from Total fee- new based on instructions @ https://flipsidecrypto.xyz/edit/queries/6e7e4b4c-8d7f-47b3-8460-c5e6ccb0b509

    with eth as (select
    d.value:"DAY" as "Day",
    'Ethereum' as "Chain",
    'Uniswap-v2' as "Pool",
    d.value:"CUMULATIVE_PROTOCOL_EARNED_FEES" as "Total protocol earned fee",
    d.value:"OWNERSHIP_RATIO" as "Share"
    from (
    select livequery.live.udf_api(
    'https://flipsidecrypto.xyz/api/v1/queries/f11e4f3e-b239-4356-bd55-bd803ae64ecd/data/latest'
    ):"data" as data
    ) responses join lateral flatten (input => responses.data) d
    order by 1 desc limit 1
    ),

    gnosis as (select
    d.value:"DAY" as "Day",
    'Gnosis' as "Chain",
    'OLAS-xDAI Balancer' as "Pool",
    d.value:"CUMULATIVE_PROTOCOL_EARNED_FEES" as "Total protocol earned fee",
    d.value:"OWNERSHIP_RATIO" as "Share"
    from (
    select livequery.live.udf_api(
    'https://flipsidecrypto.xyz/api/v1/queries/6658b507-6c01-4c92-a233-edd313c29b97/data/latest'
    ):"data" as data
    ) responses join lateral flatten (input => responses.data) d
    order by 1 desc limit 1),


    polygon as (select
    d.value:"DAY" as "Day",
    'Polygon' as "Chain",
    'OLAS-MATIC Balancer' as "Pool",
    d.value:"CUMULATIVE_PROTOCOL_EARNED_FEES" as "Total protocol earned fee",
    d.value:"OWNERSHIP_RATIO" as "Share"
    Last run: about 11 hours ago
    TOTAL_FEE
    1
    279037.384633293
    1
    20B
    4s