Skip to content
This repository has been archived by the owner on Apr 28, 2023. It is now read-only.

Commit

Permalink
fix: calculation of limits of LTC/BTC pair (#201)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael1011 authored Aug 27, 2019
1 parent c097865 commit dbe8545
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/actions/landingPageActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,18 @@ const parseLimits = (pairs, rates) => {
const pair = pairs[id];
const { base, quote } = splitPairId(id);

limits[id] = pair.limits;

// Add the limits for buy orders
if (base !== quote) {
const reverseId = `${quote}/${base}`;
const reverseRate = rates[reverseId].rate;

limits[reverseId] = {
minimal: Math.round(pair.limits.minimal / reverseRate),
maximal: Math.round(pair.limits.maximal / reverseRate),
limits[reverseId] = pair.limits;

limits[id] = {
minimal: Math.round(pair.limits.minimal * reverseRate),
maximal: Math.round(pair.limits.maximal * reverseRate),
};
} else {
limits[id] = limits.pair;
}
});

Expand Down

0 comments on commit dbe8545

Please sign in to comment.