William D. Cohan on Wall Street and Main Street.

In an interview last week, President Obama said he didn’t begrudge Jamie Dimon, the chief executive of JPMorganChase, and Lloyd Blankfein, the head man at Goldman Sachs, their 2009 bonuses of $17 million and $9 million, respectively. He said that while $17 million was “an extraordinary amount of money,” there are “some baseball players who are making more than that and don’t get to the World Series either, so I’m shocked by that as well.”

While one could argue that, metaphorically anyway, both Dimon and Blankfein made it to the World Series in 2009 — with Blankfein, whose firm earned $13.4 billion last year, being the M.V.P. — President Obama went one step further in trying to publicly support Wall Street by saying he knew both men to be “savvy businessmen,” and that “I, like most of the American people, don’t begrudge people success or wealth.”

Obama was of course simply repeating a bedrock principle of American capitalism that even the worst financial crisis since the Great Depression cannot dislodge. But one wonders if the president would be a bit more begrudging if he knew that at the height of the financial crisis, many of Goldman Sachs’s top deal-makers — although not Blankfein himself — moved quickly to unload their own stock in their firm. This happened both in March 2008, after Bear Stearns collapsed, and again that September, after the bankruptcy of Lehman Brothers and the near-unwinding of the rest of Wall Street.

If everything was really under control after Lehman collapsed, why were executives dumping their stock by the bushelful?

The whole story is contained in little-noticed public records filed with the Securities and Exchange commission — see here and here — which make enjoyable reading after spending the last year listening to the gang at Goldman and other firms whine about the terms of the Tarp program and repeatedly insist that they weren’t really in all that much trouble. Because if these savvy Goldman guys were freaking out and selling large chunks of stock in the dark days of 2008, that makes it a safe bet things were plenty bad and getting worse.

Among those executives who sold chunks of Goldman stock after the Bear Stearns debacle was Jack Levy, the co-chairman of Goldman’s mergers and acquisitions department (disclosure: he was briefly my boss when I worked in M.&A. at Merrill Lynch in the 1990s). On March 19, 2008, two days after Bear’s collapse, Levy sold 30,000 Goldman shares, at $171.32 each, generating $5.14 million. Levy also “wrote” — or sold — 60,000 October 2008 calls on Goldman stock in the market to an investor, or investors, who bet Goldman’s stock would reach $230 per share by then. Levy pocketed the premium on the calls — and of course this was a smart bet, since Goldman’s stock was trading around $90 a share by October 2008.

Also among the big sellers in March 2008 was E. Gerald Corrigan, a Goldman managing director and former head of the New York Fed, who sold 15,000 shares of Goldman for $2.6 million; Jon Winkelried, Goldman’s co-president at the time, who sold 20,000 shares for nearly $3.5 million (he quit the firm a year later after asking it to buy an additional $19.7 million of his illiquid investments); and Masanori Mochida, the head of Goldman in Japan, who sold 100,000 shares for $17.6 million.

Marc Spilker, who just resigned as head of Goldman’s asset management division, sold 11,484 shares for $2 million. David Solomon, a former Bear banker who joined Goldman in 1999 and now is co-head of investment banking, sold 8,072 of his Goldman shares at $175.89, generating just more than $1.4 million in proceeds. (He seems to have had a change of heart: On March 24, 2009, he bought 4,202 shares for $183 each, or $767,000.)

But the real action at Goldman came after Lehman blew up and the American taxpayers — through their proxies, Treasury Secretary Hank Paulson, Fed Chairman Ben Bernanke and Tim Geithner, the head of the New York Fed — decided to rescue American International Group, the global insurer. On Sept. 17, Levy sold 50,974 Goldman shares, this time for $119.99 each, generating $6.1 million; two days later he sold another 30,000 shares, for around another $4 million. (He also wrote more calls betting that Goldman’s stock wouldn’t hit $210 per share by January 2009.) Also on Sept. 17, Mochida sold 500,000 shares, at $111.44, generating $55.7 million.

At this time, too, some of the savviest of Goldman’s savvy executives sold stock, including Milton Berlinski, a longtime keeper of the Goldman flame, who sold 100,000 shares on Sept. 17, generating $10.3 million, and 75,000 shares the next day. Another big seller was Richard Friedman, who runs Goldman’s merchant banking, or principal investment, business. He sold 120,500 shares for around $12.3 million on Sept. 17, another 25,000 shares the next day for around $2.5 million, and 100,000 shares the day after for $13.8 million. In sum, Friedman — whose job made him Goldman’s ultimate long-term investor — sold around $29 million of his Goldman shares in the panic following the collapse of Lehman.

No doubt all of this fearful selling by these experienced bankers and traders could be viewed as clever, especially as Goldman’s stock shriveled to around $49 per share in November 2008, and they all likely have so much of it anyway. But now that Goldman’s stock has recovered smartly to around $155 per share and the firm is making money hand over fist, selling stock during those scary days in 2008 doesn’t look nearly as smart. Prudent, yes, but savvy, not so much.

All of which makes President Obama’s statement about Blankfein’s savvy all the more poignant. As Goldman’s chairman, any selling on his part during the depths of the financial crisis would have been viewed very negatively by the market — of course, had the market known in real time about these other executives dumping their shares, that would not have been such a great sign either. And after Goldman cut a deal with Warren Buffett to invest $5 billion in the firm on Sept. 24, 2008, Blankfein and the other top executives were largely prevented from selling stock anyway for three years.

In the end, though, things have worked out just fine for Blankfein, despite his paltry $9 million bonus: His 3.3 million Goldman shares are now worth more than $500 million.