doku
All checks were successful
Deploy / deploy-staging (push) Successful in 32s
Deploy / deploy-production (push) Has been skipped

This commit is contained in:
2026-08-21 01:04:21 +02:00
parent 70c86bd8ce
commit 95100d3a78
9 changed files with 66 additions and 37 deletions

View File

@@ -463,6 +463,12 @@ final class AnalyticsService
$settledCryptoSpendValue = $latestCurrency !== ''
? $this->settledCryptoSpendValue($purchasedMiners, $latestCurrency, $latest)
: null;
$settledCryptoSpendCurrentAsset = $latestAsset !== ''
? $this->settledCryptoSpendValue($purchasedMiners, $latestAsset, $latest)
: null;
$earnedCurrentAsset = $settledCryptoSpendCurrentAsset !== null
? $holdingsCurrentAsset + $settledCryptoSpendCurrentAsset
: $holdingsCurrentAsset;
$earnedValue = ($totalHoldingsValue !== null || $settledCryptoSpendValue !== null)
? (float) ($totalHoldingsValue ?? 0.0) + (float) ($settledCryptoSpendValue ?? 0.0)
: null;
@@ -504,10 +510,14 @@ final class AnalyticsService
'wallet_balance_current_asset' => $this->roundOrNull($walletBalanceCurrentAssetEquivalent, 6),
'wallet_balance_current_asset_direct' => $this->roundOrNull($walletBalanceCurrentAssetDirect, 6),
'holdings_current_asset' => $this->roundOrNull($holdingsCurrentAsset, 6),
'earned_current_asset' => $this->roundOrNull($earnedCurrentAsset, 6),
'wallet_value' => $this->roundOrNull($walletValue, 8),
'wallet_snapshot_measured_at' => $useWalletSnapshot ? (string) ($latestWalletSnapshot['measured_at'] ?? '') : null,
'total_holdings_value' => $this->roundOrNull($totalHoldingsValue, 8),
'variable_holdings_value' => $this->roundOrNull($totalHoldingsValue, 8),
'settled_crypto_spend_value' => $this->roundOrNull($settledCryptoSpendValue, 8),
'fixed_crypto_spend_value' => $this->roundOrNull($settledCryptoSpendValue, 8),
'fixed_crypto_spend_current_asset' => $this->roundOrNull($settledCryptoSpendCurrentAsset, 8),
'earned_value' => $this->roundOrNull($earnedValue, 8),
'break_even_remaining_amount' => $this->roundOrNull($breakEvenRemainingAmount, 8),
'break_even_days_overall' => $this->roundOrNull($breakEvenDaysOverall, 4),
@@ -1677,7 +1687,11 @@ final class AnalyticsService
continue;
}
$converted = $this->convertAmount($amount, $currency, $targetCurrency, $fxContext);
$historicalFxContext = [
'fx_fetch_id' => $miner['settled_fx_fetch_id'] ?? null,
'measured_at' => $miner['purchased_at'] ?? null,
];
$converted = $this->convertAmount($amount, $currency, $targetCurrency, $historicalFxContext);
if ($converted === null) {
continue;
}