MultipartiteBNB-chain cumulative outbound fees and outbound gas reimbursement costs (in RUNE)
    Updated 2024-01-19
    /*
    This is counting from the block which had the first synth transaction.

    Notable blocks:

    4610718 (2022-03-09): First synth transaction (Mimir MaxSynthPerAssetDepth 500 = 5%).
    4897156 (2022-03-29): Mimir MaxSynthPerAssetDepth 1500 = 15%
    4931416 (2022-04-01): Mimir VirtualMultSynths set as 1 (to prevent front-running, discovered by Bas1c; overrides Constants)

    7134336 (2022-09-01): Mimir MinimumL1OutboundFeeUSD [unset]->100000000 = 1 USD minimum outbound fee.
    */

    WITH
    dim_convert AS (
    SELECT block_timestamp, block_id
    FROM thorchain.core.dim_block
    ),
    outtable AS (
    SELECT block_id, outs.*
    FROM (thorchain.defi.fact_outbound_events AS outs INNER JOIN dim_convert ON outs.block_timestamp = dim_convert.block_timestamp)
    WHERE (blockchain = 'BNB')
    AND (block_id >= 4610718)
    HAVING tx_id IS NOT NULL
    ), --For convenient reference.
    gastable AS (
    SELECT block_id, gas.*
    FROM (thorchain.defi.fact_gas_events AS gas INNER JOIN dim_convert ON gas.block_timestamp = dim_convert.block_timestamp)
    ), --For convenient reference.

    feetable AS
    ( --Outbound fees sent to Reserve.
    --Careful that the THOR.RUNE outbound fees aren't represented in chain-specific summaries,
    --as there is no pool_name field, only asset.
    SELECT fees.block_timestamp, block_id,
    QueryRunArchived: QueryRun has been archived