Average => Median
MODIFY
WalletWasabi.Fluent/ViewModels/CoinJoinProfiles/CoinJoinProfileViewModelBase.cs
WalletWasabi.Fluent/ViewModels/CoinJoinProfiles/CoinJoinProfileViewModelBase.cs
@@ -15,5 +15,5 @@ public abstract class CoinJoinProfileViewModelBase : ViewModelBase
public virtual int MaxAnonScoreTarget { get; } = 10;
- public abstract int FeeRateAverageTimeFrameHours { get; }
+ public abstract int FeeRateMedianTimeFrameHours { get; }
}

MODIFY
WalletWasabi.Fluent/ViewModels/CoinJoinProfiles/CoinJoinProfilesViewModel.cs
WalletWasabi.Fluent/ViewModels/CoinJoinProfiles/CoinJoinProfilesViewModel.cs
@@ -61,7 +61,7 @@ public partial class CoinJoinProfilesViewModel : RoutableViewModel
keyManager.AutoCoinJoin = selected.AutoCoinjoin;
keyManager.SetAnonScoreTargets(selected.MinAnonScoreTarget, selected.MaxAnonScoreTarget, toFile: false);
- keyManager.SetFeeRateMedianTimeFrame(selected.FeeRateAverageTimeFrameHours, toFile: false);
+ keyManager.SetFeeRateMedianTimeFrame(selected.FeeRateMedianTimeFrameHours, toFile: false);
Navigate().To(new AddedWalletPageViewModel(keyManager));
}

MODIFY
WalletWasabi.Fluent/ViewModels/CoinJoinProfiles/EconomyCoinJoinProfile.cs
WalletWasabi.Fluent/ViewModels/CoinJoinProfiles/EconomyCoinJoinProfile.cs
@@ -11,5 +11,5 @@ internal class EconomyCoinJoinProfile : CoinJoinProfileViewModelBase
public override IImage Icon => AssetHelpers.GetBitmapAsset($"avares://WalletWasabi.Fluent/Assets/WalletIcons/{ThemeHelper.CurrentTheme}/normal.png");
- public override int FeeRateAverageTimeFrameHours => 168; // One week average.
+ public override int FeeRateMedianTimeFrameHours => 168; // One week average.
}

MODIFY
WalletWasabi.Fluent/ViewModels/CoinJoinProfiles/ManualCoinJoinProfile.cs
WalletWasabi.Fluent/ViewModels/CoinJoinProfiles/ManualCoinJoinProfile.cs
@@ -10,7 +10,7 @@ public class ManualCoinJoinProfile : CoinJoinProfileViewModelBase
AutoCoinjoin = autoCoinjoin;
MinAnonScoreTarget = minAnonScoreTarget;
MaxAnonScoreTarget = maxAnonScoreTarget;
- FeeRateAverageTimeFrameHours = feeRateAverageTimeFrameHours;
+ FeeRateMedianTimeFrameHours = feeRateAverageTimeFrameHours;
}
public override string Title => "Manual";
@@ -24,5 +24,5 @@ public class ManualCoinJoinProfile : CoinJoinProfileViewModelBase
public override int MaxAnonScoreTarget { get; }
- public override int FeeRateAverageTimeFrameHours { get; }
+ public override int FeeRateMedianTimeFrameHours { get; }
}

MODIFY
WalletWasabi.Fluent/ViewModels/CoinJoinProfiles/PrivateCoinJoinProfile.cs
WalletWasabi.Fluent/ViewModels/CoinJoinProfiles/PrivateCoinJoinProfile.cs
@@ -15,7 +15,7 @@ internal class PrivateCoinJoinProfile : CoinJoinProfileViewModelBase
public override int MinAnonScoreTarget { get; } = GetRandom(40, 61);
public override int MaxAnonScoreTarget { get; } = GetRandom(90, 111);
- public override int FeeRateAverageTimeFrameHours => 0;
+ public override int FeeRateMedianTimeFrameHours => 0;
private static int GetRandom(int minInclusive, int maxExclusive)
{

MODIFY
WalletWasabi.Fluent/ViewModels/CoinJoinProfiles/SpeedyCoinJoinProfile.cs
WalletWasabi.Fluent/ViewModels/CoinJoinProfiles/SpeedyCoinJoinProfile.cs
@@ -11,5 +11,5 @@ internal class SpeedyCoinJoinProfile : CoinJoinProfileViewModelBase
public override IImage Icon => AssetHelpers.GetBitmapAsset($"avares://WalletWasabi.Fluent/Assets/WalletIcons/{ThemeHelper.CurrentTheme}/normal.png");
- public override int FeeRateAverageTimeFrameHours => 0;
+ public override int FeeRateMedianTimeFrameHours => 0;
}

MODIFY
WalletWasabi.Fluent/ViewModels/Dialogs/ManualCoinJoinProfileDialogViewModel.cs
WalletWasabi.Fluent/ViewModels/Dialogs/ManualCoinJoinProfileDialogViewModel.cs
@@ -30,7 +30,7 @@ public partial class ManualCoinJoinProfileDialogViewModel : DialogViewModelBase<
new TimeFrameItem("Months", TimeSpan.FromHours(Constants.CoinJoinFeeRateMedianTimeFrames[2]))
};
- _selectedTimeFrame = _timeFrames.FirstOrDefault(tf => tf.TimeFrame == TimeSpan.FromHours(current.FeeRateAverageTimeFrameHours)) ?? _timeFrames.First();
+ _selectedTimeFrame = _timeFrames.FirstOrDefault(tf => tf.TimeFrame == TimeSpan.FromHours(current.FeeRateMedianTimeFrameHours)) ?? _timeFrames.First();
SetupCancel(enableCancel: true, enableCancelOnEscape: true, enableCancelOnPressed: true);
EnableBack = false;

MODIFY
WalletWasabi/WabiSabi/Client/CoinJoinClient.cs
WalletWasabi/WabiSabi/Client/CoinJoinClient.cs
@@ -32,7 +32,7 @@ public class CoinJoinClient
RoundStateUpdater roundStatusUpdater,
int minAnonScoreTarget = int.MaxValue,
bool consolidationMode = false,
- TimeSpan feeRateAverageTimeFrame = default,
+ TimeSpan feeRateMedianTimeFrame = default,
TimeSpan doNotRegisterInLastMinuteTimeLimit = default)
{
HttpClientFactory = httpClientFactory;
@@ -41,7 +41,7 @@ public class CoinJoinClient
RoundStatusUpdater = roundStatusUpdater;
MinAnonScoreTarget = minAnonScoreTarget;
ConsolidationMode = consolidationMode;
- FeeRateAverageTimeFrame = feeRateAverageTimeFrame;
+ FeeRateMedianTimeFrame = feeRateMedianTimeFrame;
SecureRandom = new SecureRandom();
DoNotRegisterInLastMinuteTimeLimit = doNotRegisterInLastMinuteTimeLimit;
}
@@ -61,7 +61,7 @@ public class CoinJoinClient
}
public bool ConsolidationMode { get; private set; }
- private TimeSpan FeeRateAverageTimeFrame { get; }
+ private TimeSpan FeeRateMedianTimeFrame { get; }
public async Task<bool> StartCoinJoinAsync(IEnumerable<SmartCoin> coins, CancellationToken cancellationToken)
{
@@ -425,18 +425,18 @@ public class CoinJoinClient
public bool IsRoundEconomic(FeeRate roundFeeRate)
{
- if (FeeRateAverageTimeFrame == default)
+ if (FeeRateMedianTimeFrame == default)
{
return true;
}
- if (RoundStatusUpdater.CoinJoinFeeRateMedians.TryGetValue(FeeRateAverageTimeFrame, out var averageFeeRate))
+ if (RoundStatusUpdater.CoinJoinFeeRateMedians.TryGetValue(FeeRateMedianTimeFrame, out var medianFeeRate))
{
// 0.5 satoshi difference is allowable, to avoid rounding errors.
- return roundFeeRate.SatoshiPerByte <= averageFeeRate.SatoshiPerByte + 0.5m;
+ return roundFeeRate.SatoshiPerByte <= medianFeeRate.SatoshiPerByte + 0.5m;
}
- throw new InvalidOperationException($"Could not find average feeRate for timeframe: {FeeRateAverageTimeFrame}.");
+ throw new InvalidOperationException($"Could not find median feeRate for timeframe: {FeeRateMedianTimeFrame}.");
}
/// <summary>

MODIFY
WalletWasabi/WabiSabi/Client/CoinJoinTrackerFactory.cs
WalletWasabi/WabiSabi/Client/CoinJoinTrackerFactory.cs
@@ -30,7 +30,7 @@ public class CoinJoinTrackerFactory
new InternalDestinationProvider(wallet.KeyManager),
RoundStatusUpdater,
wallet.KeyManager.MinAnonScoreTarget,
- feeRateAverageTimeFrame: TimeSpan.FromHours(wallet.KeyManager.FeeRateMedianTimeFrameHours),
+ feeRateMedianTimeFrame: TimeSpan.FromHours(wallet.KeyManager.FeeRateMedianTimeFrameHours),
doNotRegisterInLastMinuteTimeLimit: TimeSpan.FromMinutes(1));
return new CoinJoinTracker(wallet, coinJoinClient, coinCandidates, CancellationToken);

Average => Median