Four in 10 Americans are unable to cover an unexpected expense of $400 or more without resorting to borrowing money or selling some of their possessions, a Federal Reserve annual economic survey has found.

At the same time, the Fed’s fifth annual Survey of Household Economics and Decisionmaking found that in 2017 one in five Americans knew someone who was addicted to opioids or painkillers.

The grim statistics come against a backdrop of a low 3.9% unemployment rate and an economy widely seen as performing strongly – though largely failing to tackle inequality. The stock market, too, has been on a boom in recent years and many corporations are reporting strong profits.

“Even with the improvement in financial outlook, however, 40% [of Americans] still say they cannot cover a $400 emergency expense, or would do so by borrowing or selling something,” said Federal Reserve Board governor Lael Brainard in a statement.

The statistic is, however, an improvement on the 2013 figure, when half of all Americans were not prepared for a surprise financial hit of $400 or more.

At the same time, the survey found the improving economy is benefiting more Americans, including at all education and income levels. Nearly three-quarters of US adults say they are either living comfortably or doing OK financially, up from 71% in 2016.