Repository navigation
feat(reserve): add FCR-N reserve payout view - #975
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
feat(reserve)— the real change.style— the rustfmt pass + fmt tooling, separated out so the diff above doesn't drown the feature.Backend
reservemodule (models, storage, handlers) backed by SQLite tables for profit buckets, time-versioned fees, and provider display names.none/flat/tiered/per_kw/percent) mirroring the updater'sfees.toml; threshold fees floor payout at 0,percentscales income.GET /api/reserveserving a payout series + headline totals. Monthly resolution applies the monthly fee; other resolutions return gross withfee = 0.RESERVE_PROVIDERsetting (default"reserve") selects the provider key.Frontend
EnergyReservecomponent + reserve types, wired into the Energy column.Tooling
cargo fmt --checkadded 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 testpass (backend).yarn validatepasses (frontend).GET /api/reservereturns a payout series with correct fee application at monthly resolution.