Skip to content

Commit

Permalink
Poloniex implementation done.
Browse files Browse the repository at this point in the history
  • Loading branch information
bonesoul committed Oct 24, 2014
1 parent 449d64f commit ae919b0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/CoiniumServ/Markets/Exchanges/PoloniexClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Threading.Tasks;
using Newtonsoft.Json.Converters;
Expand Down Expand Up @@ -69,6 +70,10 @@ public async Task<IList<IMarketData>> GetMarkets()
Exchange = Exchange.Poloniex,
MarketCurrency = temp.Last(),
BaseCurrency = temp.First(),
Ask = double.Parse(kvp.Value.lowestAsk, CultureInfo.InvariantCulture),
Bid = double.Parse(kvp.Value.highestBid, CultureInfo.InvariantCulture),
VolumeInMarketCurrency = double.Parse(kvp.Value.quoteVolume, CultureInfo.InvariantCulture),
VolumeInBaseCurrency = double.Parse(kvp.Value.baseVolume, CultureInfo.InvariantCulture),
};

list.Add(entry);
Expand All @@ -84,7 +89,7 @@ public async Task<IList<IMarketData>> GetMarkets()
_logger.Error(e.Message);
}

return null;
return list;
}
}
}
3 changes: 3 additions & 0 deletions src/CoiniumServ/Markets/MarketManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ private void UpdateMarkets()

foreach (var task in tasks)
{
if (task.Result == null)
continue;

foreach (var entry in task.Result)
{
results.Add(entry);
Expand Down

0 comments on commit ae919b0

Please sign in to comment.