## 4 Mathematical Formulation of Market Participation  
In this subsection, a mathematical formulation is provided for the optimal participation of the second-life battery plant in the day-ahead market. The day-ahead electricity market is an organized market used for energy trading, operated by the Market Operator, one day before the delivery day. Electricity buying and selling transactions are conducted at 1 h time intervals. For example, in the day-ahead electricity market in Turkiye [27], participants submit their bids until 11:30 every day. The hourly day-ahead electricity prices for the next day are announced at 14:00. The proposed structure is addressed with a mixed-integer linear modeling approach, which is a common optimization technique used to identify the most effective solution from a range of feasible options. The primary objective is to maximize the profit obtained by the SLB energy facility in the electricity market, which is presented by Equation (6). This maximization is crucial for ensuring the financial sustainability of the energy facility. The relevant equation comprises the revenue generated from electricity sales and the costs incurred from electricity purchases, emphasizing the need to balance these two components for profitability. Equation (7) describes the energy state of each _sl_ SLB in the energy storage facility. Here, the energy state is obtained by adding the energy charged if the battery is being charged or subtracting the energy discharged if the battery is being discharged, based on the energy in the previous hour. This dynamic calculation allows the model to continuously monitor battery performance over time, which is essential for effective energy flow management. Additionally, the charge and discharge efficiencies of each battery, reflecting real-world battery performance and ensuring that energy losses are accurately accounted for in the model, are taken into account. In (8), it is ensured that each second-life battery can be charged up to its maximum energy capacity. This is a logical condition imposed for the maximum energy capacity due to the technical specifications of the battery. In the first hour of the day, the energy state of each second-life battery is defined in (9), establishing a baseline for energy management. When calculating the total energy purchased from the market to charge the SLBs each hour, (10) is used, while (11) determines the total energy sold to the electricity market by discharging the batteries each hour. These expressions represent the bid values for the amounts of energy bought and sold for energy trading at the relevant hour in the current market. The maximum charge and discharge amounts for each SLB are presented in (12) and (13), respectively, ensuring that the model adheres to the physical constraints of battery operation. (14) and (15) utilize binary decision variables to ensure that selling and buying transactions do not occur within the same hour. This constraint is essential for maintaining clear operational boundaries within the model, thus preventing conflicting trading actions. Similarly, preventing the charging and discharging processes for each battery each hour is explained in (16) and (17),