A deal crafted in the pre-dawn hours yesterday between the White House and Congress appears solid enough to ensure that a landmark bill to overhaul banking law will pass both the House and Senate and be signed into law by President Clinton within two weeks.

The legislation, which Congress and industry have tried to pass for 20 years, would revamp decades-old laws that have separated banks, securities firms and insurance companies. It would make it much easier for financial institutions to merge and sell everything from checking accounts to stocks, bonds and life insurance under one roof and one brand name.

For consumers, the disappearance of familiar names in a wave of mergers will be the most immediate effect of the bill. Financial companies already have deftly found ways around current law, permitting them to sell all sorts of financial products that were technically prohibited.

Nonetheless, industry lobbyists and federal regulators say the bill would remove regulatory shackles and make U.S. institutions more competitive at home and in global markets. In the long run that could translate into lower prices on a better array of products that would come to market more quickly than if the industry had to continue to exploit legal loopholes, officials said.

President Clinton hailed the tentative agreement, saying the bill will bring "lower costs, more choices and better protections for consumers."

Financial stocks, which have performed poorly this year, rallied strongly yesterday on news of the agreement, helping send the Dow Jones industrial average up 172.56 points, to close the day at 10,470.25. (Details, Page E1.) For example, shares of Merrill Lynch & Co., both a rumored merger predator and prey, rose 8 percent.

The legislation is a compromise version of bills that earlier this year passed the House and Senate.

But consumer groups said the compromise bill fell far short on privacy protections and other consumer provisions. While the bill requires financial institutions to craft privacy policies and to clearly spell out those policies to consumers, consumer advocates said that the bill leaves open the possibility that the vast electronic data banks possessed by financial behemoths could be exploited by marketers.

"Industry has gotten a gold mine while the American public has gotten the shaft," said Sen. Richard H. Bryan (D-Nev.), who with Sen. Richard C. Shelby (R-Ala.) and public interest groups on the right and left of the political spectrum formed a coalition to protest what they see as the bill's inadequate privacy protections.

But most lawmakers and government officials seemed happy with the final bill, saying they will have to see final language before giving final approval, but that they expect passage of the legislation.

"This agreement in principle points toward a historic modernization of our financial system," said U.S. Treasury Secretary Lawrence H. Summers from a plane traveling to Beijing.

Summers, Treasury Undersecretary Gary Gensler and White House economic adviser Gene Sperling spent most of the last week, sometimes for 12 to 14 hours at a stretch, trying to work out a compromise.

"I think I'm really happy but I'm too damned tired to know," said Ed Yingling, chief lobbyist for the American Bankers Association. Yingling, like many working to get a bill passed, stayed up until after 3 a.m. yesterday to watch lawmakers complete their negotiations.

"This is basically a done deal," Yingling said.

The breakthrough came together at 1:30 a.m. after many lobbyists and lawmakers began to despair that months of effort would again fall short. The White House and Senate Banking Committee Chairman Phil Gramm (R-Tex.) appeared unable to bridge differences over several provisions concerning the 1977 Community Reinvestment Act, which requires banks to lend to underserved customers.

Gramm dislikes the CRA. The White House had said it would veto any bank bill that it believed weakened the community lending law.

Thursday afternoon began with a formal meeting of the House and Senate lawmakers on the conference committee charged with working out a compromise bill. The public forum was scripted to end in the early evening, when key lawmakers and White House representatives were to then privately work out a deal on CRA over the next few days. Under that scenario, any deal would have been inserted into the final compromise bill, which conference members would sign off on individually.

But the public forum unexpectedly turned into a dead-serious bargaining session, forcing the conference committee chairman, House Banking Committee Chairman Jim Leach (R-Iowa), to disband the public session so that negotiators could take up their discussions in private in back rooms of the Rayburn House Office Building.

From early evening until well past midnight, a throng of lobbyists, government officials and journalists milled through Rayburn corridors, devouring dozens of pizzas moments after the delivery man dropped them off.

After 7 p.m. Gramm caused a stir by coming out of the back room, pointing to Citigroup Inc. lobbyist Roger Levy and ordering him to get Citigroup co-chairman Sanford I. Weill on the telephone to the White House. Gramm said Weill was to make a deal on CRA with the Clinton administration by 8:30 p.m. "or I'll kill the bill."

But 8:30 p.m. came and went, with no decision from the back-room negotiators. Within a few hours, however, Gramm re-emerged to say that Levy had "done his job and that the White House was moving."

White House officials say they did speak to Weill several times during talks Thursday but say he never pressured them to make a deal. And many other financial executives such as Morgan Stanley Dean Witter & Co. Chairman Philip J. Purcell and Chubb Corp. Chairman Dean R. O'Hare also made phone calls to White House officials, sources close to the talks say.

In the end, the White House persuaded Gramm to agree that, under the bill, any company out of compliance with CRA would not be allowed to take advantage of mergers or other new activities. That was the do-or-die issue that without resolution would have resulted in a presidential veto, administration officials said.

In the end for Gramm, the do-or-die issue was his demand that CRA agreements between banks and community groups be made public so residents can see if money earmarked for projects is used as intended. But White House officials and bankers worried this so-called sunshine provision would be burdensome to some community groups and could chill deals.

Those involved in the sunshine provision talks say that literally hours were spent trying to figure out how to craft wording so that such groups as the Boys Scouts wouldn't have to file formal reports on money received from a bank.

Finally, J. Virgil Mattingly Jr., general counsel to the Federal Reserve, became the hero of the late-night hour by devising wording both sides liked that gives bank regulators the discretion to write rules governing who should publicly file CRA agreements. After that, lawmakers emerged to tell waiting reporters and lobbyists they had a deal.

Overhauling the Financial Industry

For two decades, lawmakers have struggled to pass legislation that would eliminate barriers that have made it difficult and costly for banks, securities firms and insurance companies to enter one another's businesses. Early yesterday morning, the White House and congressional negotiators struck a deal, virtually ensuring legislation will pass the House and Senate next week and then will be signed into law by President Clinton.

MAJOR PROVISIONS OF THE BILL

Mergers

Repeals the Banking Act of 1933 (Glass-Steagall), which separated commercial banking from investment banking, and a 1956 law that separated bank and insurance companies. This would allow banks, insurance companies and securities firms to more easily merge or otherwise enter one another's businesses.

That process has already begun -- Citicorp bought Travelers Insurance last year, and many banks have bought securities firms -- because firms have taken advantage of loopholes and creative rules written by various regulators. But regulatory hoops have been costly for financial firms. Without the new law CitiGroup next year might have been forced to shed its insurance operations. The legislation also would create wholesale banks that cater to institutional investors and the wealthy and don't carry federal deposit insurance and so are subject to fewer federal regulations. These banks could not affiliate with banks with deposit insurance.

Privacy

Requires financial insitutions to craft privacy policies and to clearly spell out those policies to consumers in writing. With some exceptions, the bill also would allow consumers to block companies in most instances from sharing or selling information to third parties, such as telemarketers.

Banking, insurance and securities regulators are required to develop and enforce financial privacy rules.

State law was given preference over federal law if the state gives consumers greater rights to control -- and prevent -- the sale or sharing of personal financial data. Consumer groups, however, have complained that the bill language does not go far enough. For instance, information sharing would be allowed if a bank requires a third party such as a telemarketer to maintain the confidentiality of the information and notifies customers of the relationship.

Savings & Loans

Stops federal savings and loan institutions from being sold to non-banking companies, though it grandfathers several companies, including clothing retailer Nordstrom, that already own a thrift.

The government used such sales during the savings and loan crisis of the 1980s to get ailing thrifts off the government's hands to try to save taxpayers money, but recently non-bank companies have purchased thrifts as a way to offer in-house banking services such as credit cards and equity lines of credit. The practice has been dubbed derisively by critics as a buy-a-blouse-on-the-house style of financing that could lead American consumers even more heavily into debt.

But banks, which are barred from being owned by or owning a non-banking company, have argued that thrifts had an unfair advantage.

Community Lending

Retains key parts of the Community Reinvestment Act (CRA) that requires banks to lend in the same low-income or minority areas where they take deposits. Some small banks will receive less frequent CRA reviews but large banks merging with insurers or securities firms will have to have a satisfactory CRA rating. And a company that owns or is affiliated with a bank carrying an unsatisfactory CRA rating would not be able to engage in mergers or other activities permitted under the new law. But low-cost checking accounts for poor people and a study on ATM fees and other rising bank charges were voted down, against the wishes of the consumer lobbies and several lawmakers.

Regulation

Allows the Federal Reserve and Treasury to split oversight over banks entering new financial activities. Though the Fed would oversee financial holding companies, the bill, with some exceptions, calls for activities within the holding company to be regulated by the federal or state agency with the most expertise in that business.

The sale of stocks and bonds by banks would mostly be regulated by the Securities and Exchange Commission, for example. Checking accounts, lending and other traditional bank activities would be regulated at national banks by the Office of the Comptroller of the Currency, a unit of the Treasury Department.

Insurance under-writing and real estate development will have to be kept in affiliates of their holding companies, which fall under Federal Reserve scrutiny. The Treasury and the Fed would share oversight of newly allowed bank affiliates known as merchant banks that could take limited ownership positions in non-banking companies.