RayyykLiquidity Fee vs Block Rewards
    Updated 1 day ago
    with table_1 as (select date_trunc('day', block_timestamp) as day,
    avg(rune_usd) as rune_usd
    from thorchain.defi.fact_block_rewards a
    join thorchain.price.fact_rune_price b on a.day = b.block_timestamp::date
    group by 1),

    table_2 as (select a.day,
    liquidity_fee * rune_usd as liquidity_f,
    block_rewards * rune_usd as block_r,
    bonding_earnings * rune_usd as bonding_e,
    liquidity_earnings * rune_usd as liquidity_e,
    earnings * rune_usd as earning
    from thorchain.defi.fact_block_rewards a
    join table_1 b on a.day = b.day
    where a.day >= '2022-01-01'
    and a.day < date_trunc('week', current_date)
    ),

    bps as (select block_timestamp::date as date,
    sum(liq_fee_rune_usd) as total_liq_fee,
    sum(from_amount_usd) as total_volume,
    (total_liq_fee / total_volume) * 100 as avg_bps
    from thorchain.defi.fact_swaps
    --where date >= '2024-01-01'
    --and from_asset like '%.%' and to_asset like '%.%'
    group by 1),

    bps2 as (select date_trunc('week', date) as week,
    avg(avg_bps) as "Avg Fee %"
    from bps
    group by 1),

    final as (select date_trunc('week', day) as week,
    sum(liquidity_f) as liquidity_fee,
    sum(block_r) as block_rewards,
    sum(bonding_e) as bonding_earnings,
    Last run: 1 day ago
    WEEK
    Liquidity Fee
    Block Rewards
    LIQUIDITY_FEE_SHARE
    Avg Fee %
    LABEL
    Half
    1
    2025-05-12 00:00:00.000526443.125886319-4147.378900758100.794067140.06978012264Last Week0.5
    2
    2025-05-05 00:00:00.000428982.414635905-58047.839604211115.649077630.08668356923Previous Weeks0.5
    3
    2025-04-28 00:00:00.000430419.49368556718.29354572299.9957500140.08914615886Previous Weeks0.5
    4
    2025-04-21 00:00:00.000382423.16713225218.39854830599.9951891870.09054508943Previous Weeks0.5
    5
    2025-04-14 00:00:00.000498592.79833008215.99176951699.9967927220.1052401984Previous Weeks0.5
    6
    2025-04-07 00:00:00.000599494.06482131815.17631549199.9974685440.09727084481Previous Weeks0.5
    7
    2025-03-31 00:00:00.000329645.29739526715.71167556499.995233990.08611868989Previous Weeks0.5
    8
    2025-03-24 00:00:00.000593912.48195057617.16406009199.9971100850.08759474695Previous Weeks0.5
    9
    2025-03-17 00:00:00.000557791.91944702716.89905738499.9969704570.097201846Previous Weeks0.5
    10
    2025-03-10 00:00:00.000477256.06513984415.83905264999.9966813360.09268056593Previous Weeks0.5
    11
    2025-03-03 00:00:00.0001120774.0372465317.41458238199.9984462250.09029134691Previous Weeks0.5
    12
    2025-02-24 00:00:00.0004446858.5209410819.7348050499.999556210.09826214457Previous Weeks0.5
    13
    2025-02-17 00:00:00.000832294.36002788116.99057798299.9979586270.08604997716Previous Weeks0.5
    14
    2025-02-10 00:00:00.000401234.66616121943055.35147143990.3091787430.07766996768Previous Weeks0.5
    15
    2025-02-03 00:00:00.000577090.396250511230012.77434330671.5014408660.0768962758Previous Weeks0.5
    16
    2025-01-27 00:00:00.0001410141.19743999351276.58512873280.0571682310.09735921343Previous Weeks0.5
    17
    2025-01-20 00:00:00.0001429359.12171694507894.19884029873.782767930.09203741399Previous Weeks0.5
    18
    2025-01-13 00:00:00.0001035855.80097378614686.37007414262.7585177250.08118385654Previous Weeks0.5
    19
    2025-01-06 00:00:00.000857760.837735279692416.52991779555.3330770810.07808758036Previous Weeks0.5
    20
    2024-12-30 00:00:00.000377201.914169653831082.43297185931.2179757240.07206808613Previous Weeks0.5
    ...
    177
    19KB
    7s