Hi All, I realized that the quantity out you can get running this piece of code
await sor.fetchPools();
console.log(“Pools fetched!”);
const qtyIn = new BigNumber(quantityIn)
.multipliedBy(10 ** token1Decimals)
.toString()
.split(".")[0];
console.log("Amount In → ", qtyIn);
let [swaps, amountOut] = await sor.getSwaps(
token1Address,
token2Address,
“swapExactIn”,
new BigNumber(qtyIn)
);
const tempQtyOut = amountOut.dividedBy(10 ** token2Decimals);
console.log("Swaps → ", swaps);
console.log("Amount Out → ", tempQtyOut.toString());
and what I get in the app.balancer.fi trade app does not match.
Do you apply any logic on the price I can get from the getSwaps API call?
let [swaps, amountOut] = await sor.getSwaps(
token1Address,
token2Address,
“swapExactIn”,
new BigNumber(qtyIn)
);
Do you discount the fees or do you do any other logic? I don’t understand why the prices do not match.
Thanks