arXiv:2610.31447cs.DSOct 2026

Manuscript Offprint

arXiv:2610.31447

Peak-Aware One-Way Trading: Competitive and Learning-Augmented Algorithms for Energy Procurement

Jackson Bibbens, Adam Lechowicz, Nicolas Christianson, Bo Sun, Mohammad Hajiesmaili

JACKSON BIBBENS, University of Massachusetts Amherst, USA

ADAM LECHOWICZ, University of Massachusetts Amherst, USA

NICOLAS CHRISTIANSON, Johns Hopkins University, USA

BO SUN, University of Ottawa, Canada

MOHAMMAD HAJIESMAILI, University of Massachusetts Amherst, USA

We introduce peak-aware one-way trading (PA-OWT), an online problem in which a player must purchase a fixed quantity of an asset by a deadline, minimizing its total cost plus a charge proportional to the largest single purchase at any time. The model is motivated by electricity procurement, where the cost of energy rewards buying at low prices, but peak demand charges discourage concentrating purchases in short periods. Balancing these incentives is challenging when future prices are unknown: a large purchase can establish a peak that later decisions cannot undo. We develop a peak-aware online algorithm that balances price and peak control with deadline feasibility and achieves the order-optimal competitive ratio. We further extend our results to a learning-augmented algorithm that uses predictions of optimal purchasing decisions to achieve an order-optimal consistency-robustness tradeoff, exploiting accurate advice while retaining worst-case guarantees in the face of arbitrary prediction errors. Finally, we evaluate our algorithms in a case study on electricity procurement using historical electricity price traces to understand the benefits of peak-aware purchasing.

1 Introduction

In the classic one-way trading problem, an online player buys/sells shares of an item over a fixed time horizon. They observe each price sequentially and must decide how much to trade before seeing the next price. In the purchasing variant, the player must acquire a fixed quantity before the deadline while minimizing their total cost. This paper introduces peak-aware one-way trading (PA-OWT), which adds a second consideration: the player pays not only for the shares purchased, but also for the largest purchase made in any single round. Specifically, the player purchases at least one unit over a horizon of T rounds and minimizes ∑t=1Tptxt+Cmax⁡t∈[T]xt\sum_{t=1}^{T} p_t x_t + C \max_{t \in [T]} x_t, where ptp_t is the price, xtx_t is the (fractional) purchase amount, and C>0C > 0 is the peak-charge coefficient. The addition of the peak term creates a tension absent from the classic one-way trading setting: a low price encourages buying more now, but doing so can establish a peak charge that no later decision can undo.

This problem is motivated by electricity procurement for large energy consumers, such as data centers or factories. Commercial electricity bills can include both an energy charge, based on consumption, and a demand charge, based on the customer's highest power demand during the billing period [29]. These charges reward different behaviors. Time-varying energy prices encourage an operator to move consumption to cheaper intervals, whereas a demand charge encourages the operator to spread consumption out over time. For example, an enterprise charging a fleet of electric vehicles before the start of the workday can reduce energy costs by concentrating charging in a low-price interval, but doing so will increase the demand component of their energy bill.

The PA-OWT model is related to two lines of work in the online optimization literature. In online search problems such as one-way trading and k-search, there is a long-term fixed demand which can be met flexibly across the time horizon, and the goal is to purchase enough supply

Authors' Contact Information: Jackson Bibbens, University of Massachusetts Amherst, USA, jbibbens@umass.edu; Adam Lechowicz, University of Massachusetts Amherst, USA, alechowicz@umass.edu; Nicolas Christianson, Johns Hopkins University, USA, christianson@jhu.edu; Bo Sun, University of Ottawa, Canada, bo.sun@uottawa.ca; Mohammad Hajiesmaili, University of Massachusetts Amherst, USA, hajiesmaili@cs.umass.edu.

Jackson Bibbens, Adam Lechowicz, Nicolas Christianson, Bo Sun, and Mohammad Hajiesmaili

to satisfy the demand while minimizing the total purchasing cost in the face of uncertain future prices [8, 12, 26, 37]. Viewing the problem as one of allocating a fixed trading budget across prices that arrive online, these problems have an online packing structure [6, 48]. To the best of our knowledge, costs associated with peak purchases (i.e., demand charges) have not been studied in this line of work, and significantly complicate algorithm design due to their coupling the cost of decisions across time. In contrast, studies of peak-aware economic dispatch [45, 46] explicitly account for demand charges. However, in this line of work, demands are uncertain and arrive over time, and the decisions at each time are whether to purchase supply from the grid (which includes both purchasing cost and demand charge) or from an alternative supply, such as energy storage [30] or expensive local generation [15, 22, 45, 46]. However, nearly all models in this line of work have an online covering structure [3, 32], where demand must be met exactly at each stage; while some works also consider flexible demand, the proposed algorithms are typically only heuristic, and do not come with formal performance guarantees for the setting with both flexible demand and time-varying prices [24, 30, 41].

PA-OWT sits at the intersection of these tracks of literature, considering the question of how to optimally handle both a flexible, horizon-wide purchasing requirement and a peak penalty under time-varying prices. Buying aggressively at low prices risks an unnecessarily large peak if many cheap prices arrive later, while spreading purchases out more cautiously risks paying higher prices, and postponing too much procurement to the end of the instance can force a large purchase near the deadline. Knowledge of the horizon also matters: a player that knows how many rounds remain can plan how to distribute its remaining purchases, whereas a player facing an unknown horizon cannot rely on those opportunities. We therefore ask:

Is it possible to design competitive algorithms for PA-OWT that balance a purchasing cost and a peak charge while meeting a deadline?

The online algorithms literature typically studies algorithm design using worst-case competitive analysis: comparing an algorithm's total cost with that of an offline optimum that knows the entire input sequence in advance. In an electricity market context, worst-case guarantees are useful: prices are known to be non-stationary and challenging to predict [33]. However, algorithms that optimize purely for the worst-case can be overly conservative in practice. Learning-augmented algorithms provide a framework for using untrusted advice about the future (e.g., machine-learned predictions, day-ahead price forecasts, etc.) without losing the worst-case guarantees associated with traditional algorithm design. Prior related work for one-way trading and peak-aware energy scheduling has shown that such algorithms can use predictions (e.g., of the best price or the optimal decisions at each round) to improve empirical performance without sacrificing worst-case guarantees [15, 16, 22, 36]. This naturally motivates our second question:

Can predictions of the optimal purchasing decisions improve the performance of algorithms for PA-OWT while preserving a worst-case guarantee?

References (26)