Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added UniSwap Autoroutes to dashboard #467

Merged
merged 14 commits into from
Oct 19, 2022
Prev Previous commit
Next Next commit
set maxSplits
  • Loading branch information
valiafetisov committed Sep 15, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit ce84e3c01e4f14fcec1a27d86fbe8a98901d2798
18 changes: 13 additions & 5 deletions core/src/calleeFunctions/helpers/uniswapAutoRouter.ts
Original file line number Diff line number Diff line change
@@ -30,11 +30,19 @@ export const getTestQuote = async function (network: string, walletAddress: stri
const inputAmountWithCurrency = CurrencyAmount.fromRawAmount(inputToken, inputAmountInteger);

// get auto route
const route = await router.route(inputAmountWithCurrency, outputToken, TradeType.EXACT_INPUT, {
recipient: walletAddress,
slippageTolerance: new Percent(10, 100),
deadline: Math.floor(Date.now() / 1000 + 1800),
});
const route = await router.route(
inputAmountWithCurrency,
outputToken,
TradeType.EXACT_INPUT,
{
recipient: walletAddress,
slippageTolerance: new Percent(10, 100),
deadline: Math.floor(Date.now() / 1000 + 1800),
},
{
maxSplits: 0,
}
);
if (!route) {
throw new Error('the route is null, probably the input parameters are invalid');
}