File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
apps/kyberswap-interface/src/pages/CrossChainSwap/hooks Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -612,6 +612,10 @@ export const CrossChainSwapRegistryProvider = ({ children }: { children: React.R
612612 setLoading ( true )
613613 setAllLoading ( true )
614614
615+ // Track quote fetching time
616+ const quoteStartTime = performance . now ( )
617+ console . log ( '[Quote Timing] Starting to fetch quotes...' )
618+
615619 const getQuotesWithCancellation = async ( params : QuoteParams | NearQuoteParams ) => {
616620 const quotes : Quote [ ] = [ ]
617621
@@ -948,6 +952,18 @@ export const CrossChainSwapRegistryProvider = ({ children }: { children: React.R
948952 } finally {
949953 setLoading ( false )
950954 setAllLoading ( false )
955+
956+ // Log total time taken to fetch all quotes
957+ const quoteEndTime = performance . now ( )
958+ const totalTime = quoteEndTime - quoteStartTime
959+ const tokenInSymbol = ( currencyIn as any ) ?. symbol || ( currencyIn as any ) ?. wrapped ?. symbol || 'Unknown'
960+ const tokenOutSymbol = ( currencyOut as any ) ?. symbol || ( currencyOut as any ) ?. wrapped ?. symbol || 'Unknown'
961+ console . log (
962+ `[Quote Timing] All quotes fetched and processed. ${ amount } ${ tokenInSymbol } -> ${ tokenOutSymbol } . Total time: ${ totalTime . toFixed (
963+ 2 ,
964+ ) } ms (${ ( totalTime / 1000 ) . toFixed ( 2 ) } s)`,
965+ )
966+ console . log ( `[Quote Timing] Number of quotes received: ${ quotes . length } ` )
951967 }
952968 } , [
953969 sender ,
You can’t perform that action at this time.
0 commit comments