private void ExchangesTemporarilyDisabledChanged(string assetPairId, ImmutableDictionary <string, ExchangeExtPriceSettings> oldSettings, ImmutableDictionary <string, ExchangeExtPriceSettings> newSettings, string reason) { var(disable, enable) = oldSettings.FindChanges(newSettings, e => e.Key, e => e.Value.Disabled.IsTemporarilyDisabled, (o, n) => o == n, ChangeType.Add, ChangeType.Update) .Select(t => t.New) .Partition(ex => ex.Value.Disabled.IsTemporarilyDisabled); ExchangesStateChanged(assetPairId, disable.Select(t => t.Key), "disabled", reason); ExchangesStateChanged(assetPairId, enable.Select(t => t.Key), "enabled", reason); }
private void CanPerformHedgingChanged(string assetPairId, ImmutableDictionary <string, ExchangeExtPriceSettings> oldSettings, ImmutableDictionary <string, ExchangeExtPriceSettings> newSettings, string reason) { var(hedgingOn, hedgingOff) = oldSettings.FindChanges(newSettings, e => e.Key, CanPerformHedging, (o, n) => o == n, ChangeType.Add, ChangeType.Update) .Select(t => t.New) .Partition(CanPerformHedging); ExchangesStateChanged(assetPairId, hedgingOn.Select(t => t.Key), "available for hedging", reason); ExchangesStateChanged(assetPairId, hedgingOff.Select(t => t.Key), "unavailable for hedging", reason); }