ShapeShift[WIP] LP fees via SS -- TC with Days filter
    Updated 2024-02-04
    -- fees with just a single group for SS; change to block range to match dashboard
    WITH get_memo AS (
    SELECT DISTINCT TX_ID, MEMO
    FROM thorchain.defi.fact_swaps_events
    WHERE block_timestamp :: DATE BETWEEN '{{start_date}}' AND '{{end_date}}'
    )
    SELECT
    SUM(s.LIQ_FEE_ASSET_USD) AS TOTAL_FEES_USD_SUM -- Summing the liquidity fee in USD across all transactions for the specific affiliate address
    FROM thorchain.defi.fact_swaps AS s
    JOIN get_memo AS m ON s.TX_ID = m.TX_ID
    WHERE s.AFFILIATE_ADDRESS = 'ss' -- Replace 'ss' with the specific affiliate address


    Last run: over 1 year ago
    TOTAL_FEES_USD_SUM
    1
    31837.449041908
    1
    19B
    3s