The Nasdaq closed at a record high for the second day in a row with help from the technology and consumer discretionary sectors, while the S&P 500 edged higher as investors eyed solid economic data. However, bank stocks declined along with U.S. Treasury yields.

The services sector activity accelerated in May, pointing to robust economic growth in the second quarter, although trade tariffs and a shortage of workers posed a threat to the outlook.

The Nasdaq’s greatest improvement was from Amazon.com, which rose 1.9 percent, also leading gains in the S&P consumer discretionary index. Apple rose 0.8 percent, contributing the biggest point gains to the technology index and the second biggest for the Nasdaq.

The Cboe Volatility Index, the most widely followed barometer of expected near-term volatility for the S&P 500, ended the trading day down 0.34 point at 12.4, its lowest close since Jan. 26.

The financial sector was the S&P’s worst drag with a 0.4 percent decline. Bank of America and Citibank fell around 0.9 percent. Banks often trade in line with Treasury yields as higher rates can increase earnings.

Twitter shares closed up 5.1 percent on news that the social media company would join the benchmark S&P 500 index, while Netflix rose 1.1 percent after news it would enter the S&P 100 index.

Shares of packaged food companies fell as Mexico imposes tariffs on sensitive agricultural products from pork to bourbon as well as certain types of cheeses. Kellogg and General Mills were both down about 2 percent.

Approximately 6.58 billion shares changed hands on the major domestic equity exchanges, as compared to the 6.64 billion average for the past 20 sessions.

Services Sector Gains Ground

services sector activity accelerated in May, pointing to robust economic growth in the second quarter, but trade tariffs and a shortage of workers posed a threat to the outlook.

Other data on Tuesday showed job openings rising to a record high in April, far outpacing hiring. Strengthening economic growth and tightening labor market conditions likely seal the case for a Federal Reserve interest rate increase next week and raise the probability of two more hikes later in the year.

The Institute for Supply Management (ISM) said its non-manufacturing activity index jumped 1.8 points to 58.6, ending three straight monthly declines. A reading above 50 indicates expansion in the sector, which accounts for more than two-thirds of U.S. economic activity.

The ISM survey added to bullish data on consumer spending, the labor market, manufacturing and trade that have suggested the economy was regaining speed after slowing in the first quarter. Gross domestic product estimates for the second quarter are as high as a 4.8 percent annualized rate.

The ISM survey said while service industries were optimistic about business conditions and the overall economy, there continued to be concerns about “the uncertainty surrounding tariffs, trade agreements and the impact on cost of goods sold.”

Industries complained that predicting material prices this year had been difficult, with some saying the aluminum tariff had “caused supply interruptions and higher costs.”

They are also experiencing difficulties finding qualified workers, especially truck drivers, leading to bottlenecks in the supply chain.

Wholesalers described the supply chain as “shuttering because of a lack of drivers and equipment causing delays in multiple modes of transportation.”

The worker shortage was underscored by the Labor Department’s monthly Job Openings and Labor Turnover Survey, or JOLTS report showing job openings, a measure of labor demand, increased by 65,000 to a seasonally adjusted 6.7 million in April. That was the highest level since the government started tracking the series in December 2000.

The number of hires rose 92,000 to 5.6 million in April. The labor market is viewed as being either near or at full employment, with the jobless rate at an 18-year low of 3.8 percent. In April, the number of unemployed people per job opening fell to 0.9 from 1 in March.

The tight labor market could spur faster inflation than currently anticipated by Fed officials. The Fed holds its next monetary policy meeting on June 12-13. It increased borrowing costs in March and has forecast at least two more rate increases for this year.

The JOLTS report also showed a moderate rise in layoffs in April, with the layoffs and discharges rate increasing to 1.2 percent from 1.0 percent in the prior month. The layoffs were mostly in the arts, entertainment and recreation, and finance and insurance industries.

The quit rate, which the Fed looks at as a measure of job market confidence, was unchanged at 2.3 percent in April.

Job openings in April were concentrated in manufacturing and information sectors. Vacancies fell in the finance and insurance industry.

It’s A Feeding Frenzy in the World of Stock Buybacks

Corporations continued their shopping spree for their own shares in May, making $173.6 billion in buyback announcements, the highest monthly total ever, according to a research report.

In May companies also sold new shares at the fastest pace in three years, but cash takeovers of companies with U.S. listings fell to a three-month low, according to TrimTabs Investment Research.

The high number of buyback announcements was due “in large part” to expected corporate tax savings, it said.

TrimTabs said Apple was the largest spender, with an announcement for potential buybacks of up to $100 billion, while Micron Technology made a $10.0 billion announcement, followed by Qualcomm’s $8.8 billion buyback proposal.

Adobe has said it would buy $8.0 billion of its stock and T-Mobile announced $7.5 billion in buybacks.

The tally for cash takeovers involving companies with U.S. listings was $27.7 billion, according to TrimTabs. It said that the largest deals were Japanese drugmaker Takeda Pharmaceutical’s (4502.T) offer for rival Shire for $9.0 billion and Elliott Management’s $6.3 billion buyout bid for Athenahealth.

Underwriters were also active in May, with new equity offerings spiking to a three-year high of $43.6 billion, according to the report. It said that AXA Equitable Holdings’ $3.6 billion listing was the largest initial public offering since March 2017.

S&P 500 companies returned a record $1 trillion to shareholders the past year, according to a late May report from S&P Dow Jones indices. It cited a surge in dividends and stock buybacks after sweeping corporate tax cuts introduced by Republicans late in 2017.