Quantifying Chemical Degradation: Streaming Rainflow Cycles in Live Order Books
How online 3-point cycle counting converts lithium-ion Depth of Discharge (DoD) fatigue curves into dynamic Ask-price surcharges (C_deg) in real time.
“Every kilowatt-hour that flows through the battery costs a fraction of its chemical life. Rainflow counting makes that cost explicit and immediate.”
Lithium-Ion Fatigue: The Wöhler Curve
Lithium-ion cells degrade via two coupled mechanisms: calendar aging (electrolyte decomposition and SEI layer growth) and cycle aging (mechanical stress from intercalation/de-intercalation). For market-making purposes, cycle aging dominates and is well-modelled by the empirical Wöhler (S-N) fatigue relation N_cycles(d) = N₀ · d^{−β}, where d ∈ (0,1] is the Depth of Discharge (DoD), N₀ is the full-cycle count at 100 % DoD (typically 1 000–3 000 for lithium-iron-phosphate), and β ≈ 0.5 is the fatigue exponent. A deeper discharge consumes a disproportionately larger share of the battery's lifetime, which motivates dynamic pricing: the market maker should charge more for energy traded at high DoD.
Marginal Wear Cost Formula
The marginal degradation cost per kWh of throughput at a given DoD is derived by amortising the capital cost of the battery over its expected cycle life: C_deg(d) = C_cap / (2 · N_cycles(d) · E_nom · η), where C_cap is the battery replacement cost in ₹, E_nom is the nominal energy capacity in kWh, η is the roundtrip efficiency (typically 0.90–0.96 for modern LFP), and the factor of 2 accounts for the fact that a full charge-discharge cycle traverses the energy twice. Substituting N_cycles(d) = N₀ · d^{−β} yields C_deg(d) = C_cap · d^β / (2 · N₀ · E_nom · η), which is an increasing function of DoD — exactly the incentive alignment we need.
Streaming 3-Point Rainflow Algorithm
Standard rainflow counting (ASTM E1049) requires the full SoC time series to be known in advance. Sovereign-AMM uses the online streaming variant: maintain a LIFO stack of SoC reversal points. At each new reversal, check whether the middle range |stack[-2] − stack[-1]| is less than or equal to the outer range |stack[-3] − stack[-1]|. If so, pop the middle two points, record a closed half-cycle of amplitude |stack[-2] − stack[-1]| / 2, and charge C_deg accordingly; repeat until the stack condition fails or fewer than 3 points remain. This algorithm processes each new SoC sample in O(1) amortised time, making it compatible with the 10 Hz tick rate.
Integration with the Ask Quote
The accumulated cycle cost is maintained as a running exponential moving average to smooth out burst-cycle events. The current C_deg value is folded directly into the GLFT ask price: ask = mid + δ_ask(q) + C_deg. The bid side is unaffected — the market maker charges buyers for the wear cost of delivering energy but does not discount sellers, since the battery suffers wear equally on charge and discharge. In steady-state operation at moderate SoC, C_deg contributes roughly 0.005–0.015 ₹/kWh, widening the effective spread by 10–30 % compared to a model that ignores degradation.
Calibration and Sensitivity
The two key parameters N₀ and β should be calibrated per cell chemistry using manufacturer cycle-life data or in-situ capacity-fade measurements. For a typical LFP cell, N₀ ≈ 2 000 cycles at 80 % DoD translates to N₀ = 2 000 / 0.8^{−0.5} ≈ 2 236 at 100 % DoD using the Wöhler relation. Sensitivity analysis shows that a 20 % error in N₀ propagates linearly to C_deg, while a 0.1 shift in β changes C_deg by approximately d^{0.1} ≈ 6 % at 50 % DoD — modest enough that the model is reasonably robust to calibration uncertainty. The degradation weight slider in JudgeControls allows operators to scale C_deg in real time without recalibrating the underlying Wöhler curve.