Use slippage adjusted swap quote for two hop swap (#106)

This commit is contained in:
Phil Chen 2023-06-26 19:40:49 -10:00 committed by GitHub
parent 0fdf8e5dc6
commit 42ca95a4bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -97,7 +97,7 @@ export async function getSwapFromRoute(
]
);
const inputAmount = quoteOne.estimatedAmountIn;
const inputAmount = quoteOne.amountSpecifiedIsInput ? quoteOne.estimatedAmountIn : quoteOne.otherAmountThreshold;
addOrNative(mintOneA.toString(), quoteOne.aToB ? inputAmount : ZERO);
addOrNative(mintOneB.toString(), !quoteOne.aToB ? inputAmount : ZERO);
addOrNative(mintTwoA.toString(), ZERO);