WHEN Donald Trump won America’s presidential election 14 months ago, banks’ share prices leapt. One reason for that was the prospect of lower corporate taxes, which would both benefit banks directly and (investors hoped) ginger up the economy. Like Mr Trump’s legislative agenda, their shares were becalmed for much of 2017, but they perked up late in the year when the Tax Cuts and Jobs Act looked likely to become law—as it duly did when the president signed it on December 22nd.

Yet several banks expect the act to make deep dents in fourth-quarter profits. On December 28th Goldman Sachs said it was braced for a $5bn hit. A week before, Bank of America (BofA) announced a $3bn write-down. Early in the month, on fairly accurate assumptions about the law’s final form, Citigroup put the cost at a whopping $20bn. Foreign banks are also assessing the damage: £1bn ($1.4bn), says Barclays; SFr2.3bn ($2.4bn), reckons Credit Suisse.

These one-off hits have two main causes. First, many banks carry “deferred tax assets” (DTAs) on their balance-sheets, largely past losses—a legacy, for many, of the financial crisis—carried forward to set against future taxes. The higher the tax rate, the more these assets are worth. So the new law, by cutting the federal corporate-tax rate from 35% to 21%, slashes their value. Citigroup, with $43.2bn of American DTAs on the books, and BofA, with $7bn, according to Mike Mayo of Wells Fargo, have the biggest piles. Reduced DTAs account for the bulk of their write-downs, as well as for those at Barclays and Credit Suisse.

Second, cash repatriated from abroad will be taxed at 15.5%—below the main rate, giving banks an incentive to bring it home. This accounts for around two-thirds of Goldman’s $5bn; JPMorgan Chase has said repatriation could cost up to $2bn. Foreign banks face a further niggle: the law taxes payments from American entities to foreign affiliates—a measure called the base erosion and anti-abuse tax, or BEAT. Credit Suisse says it is “likely to be affected” by BEAT; Barclays thinks negative effects are “possible”. Neither has named a figure.

Though banks expect the biggest blows, they are not alone. BP and Royal Dutch Shell have announced DTA write-downs too. (Some companies, notably Berkshire Hathaway, have deferred tax liabilities, so should get a fillip.) Plenty more American firms have billions stashed abroad.

Still, the short-term damage is not as bad as it looks. Because supervisors largely disregard DTAs anyway, Citigroup expects its main regulatory measure of capital to fall by only $4bn, from $162bn. And looking ahead, the tax cut should indeed be a boon. Mr Mayo says that American banks’ effective tax rate in the first half of 2017 was 31% (including state levies); that may fall by around eight points. Granted, some gains may be passed on to customers; and, under the new law, big banks’ deposit-insurance premiums are no longer tax-deductible. Even so, Mr Mayo expects earnings per share to rise by 5-10%.

Regional lenders, with little business abroad, should gain more than Wall Street firms. They also have lower DTAs, meaning less pain now. But big banks, despite the chunky write-downs, should benefit too. Dry those tears.