File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
src/swapService/strategies Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -304,9 +304,10 @@ export class StrategyBalmySDK {
304
304
( currentAmountTo * 1000n ) / overSwapTarget > 1005n
305
305
306
306
// single run to preselect sources
307
- const initialQuotes = (
308
- await Promise . all (
309
- unitQuotes . map ( ( unitQuote ) => {
307
+ const initialQuotesSettled = await Promise . allSettled (
308
+ unitQuotes
309
+ . filter ( ( unitQuote ) => unitQuote . minBuyAmount . amount !== 0n )
310
+ . map ( ( unitQuote ) => {
310
311
const estimatedAmountIn = calculateEstimatedAmountFrom (
311
312
unitQuote . minBuyAmount . amount ,
312
313
swapParamsExactIn . amount ,
@@ -323,8 +324,10 @@ export class StrategyBalmySDK {
323
324
} ,
324
325
)
325
326
} ) ,
326
- )
327
- ) . flat ( )
327
+ )
328
+ const initialQuotes = initialQuotesSettled
329
+ . filter ( ( q ) => q . status === "fulfilled" )
330
+ . flatMap ( ( q ) => q . value )
328
331
329
332
const allSettled = await Promise . allSettled (
330
333
initialQuotes . map ( async ( initialQuote ) =>
You can’t perform that action at this time.
0 commit comments