Skip to content

Commit

Permalink
fix a decimal bug
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelQZQ committed Nov 7, 2023
1 parent 39dc7fa commit b57c809
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ThalaswapRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ class ThalaswapRouter {
const tokenOutDecimals = this.coins!.find(
(coin) => coin.address === route.path[route.path.length - 1].to,
)!.decimals;
const args =
const args: [number, number] =
route.type === "exact_input"
? [
scaleUp(route.amountIn, tokenInDecimals),
Expand All @@ -232,10 +232,10 @@ class ThalaswapRouter {
),
]
: [
scaleUp(route.amountOut, tokenInDecimals),
scaleUp(route.amountOut, tokenOutDecimals),
scaleUp(
calcMaxSoldValue(route.amountIn, slippagePercentage),
tokenOutDecimals,
tokenInDecimals,
),
];
if (route.path.length == 1) {
Expand Down

0 comments on commit b57c809

Please sign in to comment.