break even
All checks were successful
Deploy / deploy-staging (push) Successful in 33s
Deploy / deploy-production (push) Has been skipped

This commit is contained in:
2026-08-21 01:32:28 +02:00
parent b0a3ab4033
commit 01ef5127b1
3 changed files with 9 additions and 11 deletions

View File

@@ -3338,7 +3338,7 @@
? `${fmtNumber(breakEvenDaysOverall, 2)} Tage`
: (investedCapital === null ? 'Keine Mietbasis' : 'Nicht erreichbar'),
sub: investedCapital !== null
? `${breakEvenEta ? `ETA ${breakEvenEta} · ` : ''}Cash ${fmtMoney(investedCapital, reportCurrency)}${reinvestedCapital !== null ? ` · Reinvest ${fmtMoney(reinvestedCapital, reportCurrency)}` : ''}`
? `${breakEvenEta ? `ETA ${breakEvenEta} · ` : ''}Cash ${fmtMoney(investedCapital, reportCurrency)}${reinvestedCapital !== null ? ` · Reinvest fix ${fmtMoney(reinvestedCapital, reportCurrency)}` : ''}`
: (breakEvenPrice !== null
? `Break-even-Kurs ${fmtNumber(breakEvenPrice, 6)} ${reportCurrency}`
: (investedCapital === null

View File

@@ -150,6 +150,10 @@ Beim Schema-Upgrade werden vorhandene Krypto-Miner einmalig bewertet:
Jede neu gespeicherte Buchung, die einen Kurs oder eine Waehrungsumrechnung benoetigt, muss die verwendete `fx-rates.fetch_id` gemeinsam mit Betrag, Quellwaehrung und Zielwaehrung speichern. Ein aktueller Kurs darf ausschliesslich fuer variable, noch gehaltene Bestaende verwendet werden. Fehlt fuer eine neue feste Buchung ein FX-Snapshot, muss der Speichervorgang fehlschlagen; ein stiller Fallback ist nicht erlaubt.
## Break-even
Der Cash-Break-even verwendet ausschliesslich Fiat-Investitionen gegen aktuelle, noch gehaltene Miner- und Walletbestaende. Krypto-Reinvestitionen werden daneben als `Reinvest fix` angezeigt und muessen immer den historischen festen Gegenwert aus dem zugeordneten `fx-rates`-Snapshot verwenden; eine Bewertung zum aktuellen Coin-Kurs ist unzulässig.
## Verbindliche Fachregeln: Zielminer-ETA
1. Die Zielminer-ETA basiert ausschliesslich auf dem letzten Mining-Upload, dessen Coin-Bestand und dem Durchschnitt seit dem letzten Transfer (`doge_per_day_since_last_payout`, technisch historisch benannt).

View File

@@ -414,16 +414,7 @@ final class AnalyticsService
'cash'
)
: null;
$reinvestedCapital = $latestCurrency !== ''
? $this->totalInvestmentBasis(
is_array($settings['cost_plans'] ?? null) ? $settings['cost_plans'] : [],
$purchasedMiners,
$latestMeasuredTs,
$latestCurrency,
$latest,
'reinvest'
)
: null;
$reinvestedCapital = null;
$walletBalances = $this->walletBalances($payouts, $walletWithdrawals, $purchasedMiners, 0);
$latestWalletSnapshot = $this->latestWalletSnapshot(is_array($options['wallet_snapshots'] ?? null) ? $options['wallet_snapshots'] : []);
$latestWalletSnapshotTs = is_array($latestWalletSnapshot)
@@ -467,6 +458,9 @@ final class AnalyticsService
$settledCryptoSpendValue = $latestCurrency !== ''
? $this->settledCryptoSpendValue($purchasedMiners, $latestCurrency, $latest)
: null;
// Reinvestments are spent coins, not a current crypto holding. Their historical
// settlement value is therefore the only valid break-even display basis.
$reinvestedCapital = $settledCryptoSpendValue;
$settledCryptoSpendCurrentAsset = $latestAsset !== ''
? $this->settledCryptoSpendValue($purchasedMiners, $latestAsset, $latest)
: null;