File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
src/swapService/strategies Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -296,7 +296,13 @@ export class StrategyBalmySDK {
296
296
sourcesFilter ,
297
297
)
298
298
299
- const unitAmountTo = unitQuotes [ 0 ] . minBuyAmount . amount
299
+ // Pick a random quote to avoid lock in if one source returns a false quote
300
+ // FIXME: use unit quotes as initial quotes
301
+ const unitAmountTo =
302
+ unitQuotes [ Math . floor ( Math . random ( ) * unitQuotes . length ) ] . minBuyAmount
303
+ . amount
304
+
305
+ // const unitAmountTo = unitQuotes[0].minBuyAmount.amount
300
306
301
307
const estimatedAmountIn = calculateEstimatedAmountFrom (
302
308
unitAmountTo ,
@@ -306,6 +312,7 @@ export class StrategyBalmySDK {
306
312
)
307
313
308
314
if ( estimatedAmountIn === 0n ) throw new Error ( "quote not found" )
315
+ console . log ( "estimatedAmountIn: " , estimatedAmountIn )
309
316
310
317
const overSwapTarget = adjustForInterest ( swapParams . amount )
311
318
You can’t perform that action at this time.
0 commit comments