Multipartite2023-09-24 (2022-12-30 through 2023-07-01) Half-year of Reserve inflow and outflow copy
    Updated 2023-09-24
    SELECT
    SUM(IFF(to_address = 'thor1dheycdevq39qlkxs2a6wuuzyn4aqxhve4qxtxt', amount_e8, 0)) / 1e8 AS rune_transferred_to_reserve,
    SUM(IFF(from_address = 'thor1dheycdevq39qlkxs2a6wuuzyn4aqxhve4qxtxt', amount_e8, 0)) / 1e8 AS rune_transferred_from_reserve,
    rune_transferred_from_reserve - rune_transferred_to_reserve AS net_rune_transferred_from_reserve
    FROM (thorchain.core.fact_transfer_events AS reftable INNER JOIN thorchain.core.dim_block
    ON reftable.dim_block_id = dim_block.dim_block_id)
    WHERE block_id BETWEEN 3636270 + 1 + 5256000 AND 3636270 + 1.5 * 5256000
    -- 3636270 is the block of the most recent Standby Reserve transfer to the Reserve (60 million RUNE);
    -- 5256000 is BlocksPerYear.
    AND 'thor1dheycdevq39qlkxs2a6wuuzyn4aqxhve4qxtxt' in (from_address, to_address)

    /*
    [EDIT THE BLOCKS BELOW:]
    The actual balance change observed:
    https://thornode-v1.ninerealms.com/thorchain/balance/module/reserve?height=8892270
    https://thornode-v1.ninerealms.com/thorchain/balance/module/reserve?height=11520270
    99,988,193.60230011 - 87,548,121.03817056
    = 12,440,072.56412955 RUNE
    (so, rounded in Flipside to the nearest 1e5, but otherwise consistent)

    This 'RUNE in' includes all RUNE in, including outbound fee RUNE (followed by gas reimbursement RUNE out)
    and liquidity fees from the Pool Module (followed by going out to the Bond Module while keeping nothing).

    For more detailed information regarding revenue types, please refer to
    https://flipsidecrypto.xyz/Multipartite/reserve-cumulative-income-health-rOUjF2
    .
    */


    Run a query to Download Data