def gen_to_sender(
    miners: list,
    configs: dict,
    monthly_miner_snapshot: list,
    monthly_storage_snapshot: list,
):
    """
    A helper function that processes the data from the simulation and then returns
    a dictionary containing useful charts and data.
    Params:
        miners: a list of the miners in the system
        configs: the simulation configs passed in originally
        monthly_miner_snapshot: list of the amount of miners per month
        monthly_storage_snapshot: list of the storage in the network per month
    Returns:
        A dictionary of useful data
    """

    # Our simulation runner miner.
    miner = miners[0]

    # NOTE: our selected miner / box represents the uers viewing the app
    avg_tokens_per_day = sum(miner.daily_rewards) / 12
    yearly_mined_tokens = sum(miner.monthly_rewards)
    EOY_value = yearly_mined_tokens * configs["global_params"]["token_value"]

    # NOTE: Calc the users costs / savings
    power_cost = configs["user_config"]["avg_power_consumption"] * 12
    cloud_savings = configs["user_config"]["avg_monthly_storage_cost"] * 12

    current_token_value = configs["global_params"]["token_value"]

    # An array to model the X-axis on a few graphs
    time_array = [i for i in range(1, 13)]

    # Shows the amount of miners for each month
    miner_plot = {
        "data": [
            {
                "x": time_array,
                "y": monthly_miner_snapshot,
                "name": "Miners",
                "type": "line",
            }
        ]
    }

    monthly_sub_total = []
    sub_val = []
    tokens = 0

    # print(len(miner.monthly_rewards))
    for i in range(len(miner.monthly_rewards)):

        amnt = miner.monthly_rewards[i]

        if len(monthly_sub_total) == 0:
            monthly_sub_total.append(amnt)
            tokens = amnt
        else:
            monthly_sub_total.append(monthly_sub_total[i - 1] + amnt)
            tokens = monthly_sub_total[-1]

        sub_val.append(float(tokens) * current_token_value)

    # A plot that shows as miners increase, tokens rewarded per miner (based
    # on amount of storage the individual provides)
    token_accum_plot = {
        "data": [
            {
                "x": time_array,
                "y": miner.monthly_rewards,
                "type": "line",
                "name": "Mined Rewards",
            },
            {
                "x": time_array,
                "y": monthly_sub_total,
                "type": "line",
                "name": "Accumulated Tokens",
            },
        ]
    }

    # Shows the increase in monthly storage increase
    network_plot = {
        "data": [
            {
                "x": time_array,
                "y": monthly_storage_snapshot,
                "type": "line",
                "labels": {"x": " Months", "y": "Monthly Network Storage"},
            }
        ]
    }

    network_table = {
        "Start of Year Storage (TB)": round(monthly_storage_snapshot[0], 2),
        "End of Year Storage (TB)": round(monthly_storage_snapshot[-1], 2),
        "Monthly % Change in Storage": configs["box_config"]["rate_of_change"],
        "Token Value (USD)": configs["global_params"]["token_value"],
    }

    storage_table = {
        "Mined Token Value (USD)": round(EOY_value, 2),
        "User Cloud Storage Savings (USD)": cloud_savings,
        "Electricity Cost (USD)": 12
        * float(configs["user_config"]["avg_power_consumption"]),
        "Net Profit (USD)": round(((EOY_value - power_cost) + cloud_savings), 2),
        "Yearly Token Reward": round(yearly_mined_tokens, 3),
        "Avg Daily Token Reward": round(avg_tokens_per_day, 3),
    }

    # the final dictionary with all of our calculations
    return {
        "tables": {
            "network_table": network_table,
            "storage_table": storage_table,
        },
        "plots": {
            "token_accum_plot": token_accum_plot,
            "network_storage_plot": network_plot,
            "miner_plot": miner_plot,
        },
    }