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

Commit

Permalink
database changed
Browse files Browse the repository at this point in the history
  • Loading branch information
Hammad-Mubeen committed Feb 4, 2022
1 parent cbfb396 commit ab5f572
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions routes/pathroutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,25 +132,25 @@ router.route("/getpathreserves").post(async function (req, res, next) {
if (i == 0) {
if (pairs[j].token1.symbol == path[i + 1]) {
reserve0 =
parseFloat(pairs[j].reserve0) / parseFloat(pairs[j].reserve1);
parseFloat(pairs[j].reserve1) / parseFloat(pairs[j].reserve0);
break;
}
} else if (i != path.length - 1) {
if (pairs[j].token1.symbol == path[i + 1]) {
reserve0 = reserve0 / (parseFloat(pairs[j].reserve1)/10**9);
reserve0 = parseFloat(reserve0) *(parseFloat(pairs[j].reserve1) / parseFloat(pairs[j].reserve0));
break;
}
}
} else if (pairs[j].token1.symbol == path[i]) {
if (i == 0) {
if (pairs[j].token0.symbol == path[i + 1]) {
reserve0 =
parseFloat(pairs[j].reserve1) / parseFloat(pairs[j].reserve0);
parseFloat(pairs[j].reserve0) / parseFloat(pairs[j].reserve1);
break;
}
} else if (i != path.length - 1) {
if (pairs[j].token0.symbol == path[i + 1]) {
reserve0 = reserve0 / (parseFloat(pairs[j].reserve0)/10**9);
reserve0 = parseFloat(reserve0) * (parseFloat(pairs[j].reserve0) / parseFloat(pairs[j].reserve1));
break;
}
}
Expand All @@ -165,25 +165,25 @@ router.route("/getpathreserves").post(async function (req, res, next) {
if (i == 0) {
if (pairs[j].token1.symbol == path[i + 1]) {
reserve1 =
parseFloat(pairs[j].reserve0) / parseFloat(pairs[j].reserve1);
parseFloat(pairs[j].reserve1) / parseFloat(pairs[j].reserve0);
break;
}
} else if (i != path.length - 1) {
if (pairs[j].token1.symbol == path[i + 1]) {
reserve1 = reserve1 / (parseFloat(pairs[j].reserve1)/10**9);
reserve1 = parseFloat(reserve1) * (parseFloat(pairs[j].reserve1) / parseFloat(pairs[j].reserve0));
break;
}
}
} else if (pairs[j].token1.symbol == path[i]) {
if (i == 0) {
if (pairs[j].token0.symbol == path[i + 1]) {
reserve1 =
parseFloat(pairs[j].reserve1) / parseFloat(pairs[j].reserve0);
parseFloat(pairs[j].reserve0) / parseFloat(pairs[j].reserve1);
break;
}
} else if (i != path.length - 1) {
if (pairs[j].token0.symbol == path[i + 1]) {
reserve1 = reserve1 / (parseFloat(pairs[j].reserve0)/10**9);
reserve1 = parseFloat(reserve1) * ( parseFloat(pairs[j].reserve0) / parseFloat(pairs[j].reserve1));
break;
}
}
Expand Down

0 comments on commit ab5f572

Please sign in to comment.