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 @@ -609,6 +609,10 @@ export const CrossChainSwapRegistryProvider = ({ children }: { children: React.R
609609 setLoading ( true )
610610 setAllLoading ( true )
611611
612+ // Track quote fetching time
613+ const quoteStartTime = performance . now ( )
614+ console . log ( '[Quote Timing] Starting to fetch quotes...' )
615+
612616 const getQuotesWithCancellation = async ( params : QuoteParams | NearQuoteParams ) => {
613617 const quotes : Quote [ ] = [ ]
614618
@@ -932,6 +936,18 @@ export const CrossChainSwapRegistryProvider = ({ children }: { children: React.R
932936 } finally {
933937 setLoading ( false )
934938 setAllLoading ( false )
939+
940+ // Log total time taken to fetch all quotes
941+ const quoteEndTime = performance . now ( )
942+ const totalTime = quoteEndTime - quoteStartTime
943+ const tokenInSymbol = ( currencyIn as any ) ?. symbol || ( currencyIn as any ) ?. wrapped ?. symbol || 'Unknown'
944+ const tokenOutSymbol = ( currencyOut as any ) ?. symbol || ( currencyOut as any ) ?. wrapped ?. symbol || 'Unknown'
945+ console . log (
946+ `[Quote Timing] All quotes fetched and processed. ${ amount } ${ tokenInSymbol } -> ${ tokenOutSymbol } . Total time: ${ totalTime . toFixed (
947+ 2 ,
948+ ) } ms (${ ( totalTime / 1000 ) . toFixed ( 2 ) } s)`,
949+ )
950+ console . log ( `[Quote Timing] Number of quotes received: ${ quotes . length } ` )
935951 }
936952 } , [
937953 sender ,
You can’t perform that action at this time.
0 commit comments