doku
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user