Skip to content

Commit

Permalink
Revert "test"
Browse files Browse the repository at this point in the history
This reverts commit a9078be.
  • Loading branch information
rouzwelt committed Dec 26, 2024
1 parent a9078be commit a5de081
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions src/modes/routeProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -540,23 +540,6 @@ export function findMaxInput({
const result: BigNumber[] = [];
const ratio = orderPairObject.takeOrders[0].quote!.ratio;
const pcMap = dataFetcher.getCurrentPoolCodeMap(fromToken, toToken);
if (
fromToken.address.toLowerCase() ===
"0xb02541995f317fd47c5df8e8fba7284b502b5d7b".toLowerCase() ||
toToken.address.toLowerCase() === "0xb02541995f317fd47c5df8e8fba7284b502b5d7b".toLowerCase()
) {
pcMap.forEach((x) => {
if (
x.pool.token0.address.toLowerCase() ===
"0xb02541995f317fd47c5df8e8fba7284b502b5d7b".toLowerCase() ||
x.pool.token1.address.toLowerCase() ===
"0xb02541995f317fd47c5df8e8fba7284b502b5d7b".toLowerCase()
) {
// eslint-disable-next-line no-console
console.log(x);
}
});
}
const initAmount = scale18To(maximumInputFixed, fromToken.decimals).div(2);
let maximumInput = BigNumber.from(initAmount.toString());
for (let i = 1; i < 26; i++) {
Expand All @@ -575,26 +558,8 @@ export function findMaxInput({
);

if (route.status == "NoWay") {
if (
fromToken.address.toLowerCase() ===
"0xb02541995f317fd47c5df8e8fba7284b502b5d7b".toLowerCase() ||
toToken.address.toLowerCase() ===
"0xb02541995f317fd47c5df8e8fba7284b502b5d7b".toLowerCase()
) {
// eslint-disable-next-line no-console
console.log("noway", maximumInput.toString());
}
maximumInput = maximumInput.sub(initAmount.div(2 ** i));
} else {
if (
fromToken.address.toLowerCase() ===
"0xb02541995f317fd47c5df8e8fba7284b502b5d7b".toLowerCase() ||
toToken.address.toLowerCase() ===
"0xb02541995f317fd47c5df8e8fba7284b502b5d7b".toLowerCase()
) {
// eslint-disable-next-line no-console
console.log("way", maximumInput.toString());
}
const amountOut = scale18(route.amountOutBI, toToken.decimals);
const price = amountOut.mul("1" + "0".repeat(18)).div(maxInput18);

Expand Down

0 comments on commit a5de081

Please sign in to comment.