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

fix: calculation of limits of LTC/BTC pair #201

Merged
merged 1 commit into from
Aug 27, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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