public async Task ProcessTrade(Trade tradeLogItem, MarketType market) { var redisKey = _settings.GetKeyForTradeAnonId(tradeLogItem.Id); if (await _cache.GetAsync(redisKey) == null) { var topic = $"trades.{market.ToString().ToLower()}.{tradeLogItem.AssetPairId.ToLower()}"; var subject = _realm.Services.GetSubject <Trade>(topic); subject.OnNext(tradeLogItem); await _cache.SetAsync( redisKey, _redisValue, new DistributedCacheEntryOptions { AbsoluteExpiration = DateTimeOffset.Now.AddDays(1) }); } }