Skip to content

feat(reserve): add FCR-N reserve payout view - #975

Merged
eetu merged 2 commits into
developfrom
feat/energy-reserve
Jun 14, 2026
Merged

eetu merged 2 commits into
developfrom
feat/energy-reserve

Conversation

@eetu

@eetu eetu commented Jun 14, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a reserve feature surfacing FCR-N reserve-market income (fcr_up / fcr_down), provider fees, and spot-arbitrage savings, rendered in the Energy section.

Split into two commits for review:

  1. feat(reserve) — the real change.
  2. style — the rustfmt pass + fmt tooling, separated out so the diff above doesn't drown the feature.

Backend

  • New reserve module (models, storage, handlers) backed by SQLite tables for profit buckets, time-versioned fees, and provider display names.
  • Generic fee model (none/flat/tiered/per_kw/percent) mirroring the updater's fees.toml; threshold fees floor payout at 0, percent scales income.
  • GET /api/reserve serving a payout series + headline totals. Monthly resolution applies the monthly fee; other resolutions return gross with fee = 0.
  • RESERVE_PROVIDER setting (default "reserve") selects the provider key.

Frontend

  • EnergyReserve component + reserve types, wired into the Energy column.

Tooling

  • cargo fmt --check added to the pre-commit hook and CI (rustfmt component pulled in); backend reflowed to satisfy it.

Test plan

  • cargo fmt --check, cargo clippy -- -D warnings, cargo test pass (backend).
  • yarn validate passes (frontend).
  • GET /api/reserve returns a payout series with correct fee application at monthly resolution.

eetu added 2 commits June 14, 2026 21:49
Add a "reserve" feature that surfaces FCR-N reserve market income
(fcr_up/fcr_down), provider fees, and spot-arbitrage savings.

Backend:
- New reserve module (models, storage, handlers) backed by SQLite tables
  for profit buckets, time-versioned fees, and provider display names.
- Generic fee model (none/flat/tiered/per_kw/percent) mirroring the
  updater's fees.toml; threshold fees floor payout at 0, percent scales.
- GET /api/reserve serving a payout series + headline totals; monthly
  resolution applies the monthly fee, other resolutions return gross.
- RESERVE_PROVIDER setting (default "reserve") selects the provider key.

Frontend:
- EnergyReserve component + reserve types, wired into the Energy section.
Add `cargo fmt --check` to the pre-commit hook and CI (pull in the
rustfmt component), then apply the resulting rustfmt pass across the
backend. Formatting only — no behavior change.
@eetu
eetu merged commit a08913a into develop Jun 14, 2026
3 checks passed
@eetu
eetu deleted the feat/energy-reserve branch June 14, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant