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

@@ -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;