Stocks in the United States gained modestly in a lacklustre session, while treasuries rose after a report showed inflation moderated slightly in April, and swaps traders increased their bets that the Federal Reserve will cut rates this year.

The S&P 500 fluctuated between gains and losses before finishing the day up 0.4%. The tech-heavy Nasdaq 100 gained 1.1%, marking the gauge's highest close since August 18. The benchmarks were bolstered by so-called faang names such as Amazon, Apple, and Microsoft. Airbnb fell after issuing a cautious forecast for second-quarter sales, while Rivian Automotive rose after reaffirming production plans.

In April, US consumer prices rose 0.4%, with the headline CPI rising 4.9% year on year, marking the first reading below 5% in two years. That's still well above the Fed's 2% target, as officials balance the need to rein in inflation against the risk of a recession and banking sector anxiety.

Policy-sensitive Treasury yields on two-year notes fell to 3.90%, while 10-year yields were 3.43%. Traders are pricing in roughly 75 basis points of interest rate cuts this year, according to swap contracts.