We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b6c3a07 commit 5c08dafCopy full SHA for 5c08daf
connect/src/routes/portico/automatic.ts
@@ -201,6 +201,9 @@ export class AutomaticPorticoRoute<N extends Network>
201
try {
202
const swapAmounts = await this.fetchSwapQuote(request, params);
203
204
+ // destination token may have a different number of decimals than the source token
205
+ // so we need to scale the amounts to the token with the most decimals
206
+ // before comparing them
207
const maxDecimals = Math.max(request.source.decimals, request.destination.decimals);
208
const scaledAmount = amount.units(amount.scale(params.normalizedParams.amount, maxDecimals));
209
const scaledMinAmountFinish = amount.units(
0 commit comments