After recovering from weakness at the opening, stocks pushed to record highs on Friday in response to a short-term agreement on extending Greek loans between Athens, the eurozone, the European Central Bank and the International Monetary Fund.
It's not a done deal: Greece has to draft a list of proposed economic reforms by Monday and submit it for approval before any next steps. But it pushes back the deadline for agreement on tough issues to April and lessens the risk Greek banks aren't going to reopen next Tuesday after a three-day holiday weekend.
When Friday trading was over, the Dow Jones industrial average rose 154 points, or 0.9 percent, to close at 18,140. The S&P 500 gained 13 points, or 0.6 percent, to end at 2,110. And Nasdaq added 31 points, or 0.6 percent, finishing at 4,956.
Small caps were less enthusiastic, with the Russell 2000 adding 4 points, or 0.3 percent, closing at 1,232.
It's worth noting that investors demonstrated a little irony in all this, given that stocks have ripped higher all month on the general feeling that either Greece didn't matter or that a deal was pretty much assured. And yet, as positive headlines crossed Friday afternoon stocks ripped higher -- suggesting this attitude wasn't fully priced in after all.
Crude oil lost 2.6 percent to close at $50.81 a barrel in response to a slowdown in the pace that U.S. oil drilling rigs are being pulled. The Baker Hughes rig count dropped to 1,310 from 1,358 last week -- a 3.3 percent week-over-week decline. That's slowing than the recent rate of declines of 6.7 percent, 5.5 percent and 5.5 percent over the last three weeks.
The drop in oil prices suggests that the U.S. rig count will fall toward 970 in the weeks to come. Yet, both oil production and inventories have swelled to fresh records, and offshore floating storage is coming into play -- suggesting oil prices could come under fresh pressure.
Back to Greece.
If the European establishment and the International Monetary Fund don't approve of the reform proposals Greece is to submit on Monday, officials said another full meeting of eurozone finance ministers will happen on Tuesday. So, the risk that the deal will collapse is still very real.
As far as winners and losers, Athens seems to have gained some flexibility on the size of the budget surplus it will be required to run this year and could potentially win debt relief in any new agreement that's negotiated over the next four months. The European establishment gained a recommitment to the existing bailout program from Greece's new government and a pledge to stop unilateral, anti-austerity actions.
Still, the gap is wide on serious issues. The Greek Finance Minister Yanis Varoufakis said on Friday that public pensions would not be cut and taxes would not be raised. European officials, by setting the deadline for a new deal in April, backed Athens against the wall of large debt maturities in May and June -- raising the stakes of any failure by increasing the risk Greece would have to default on its obligations.
Another big question is whether the Greek people will support this agreement. By taking a hard-line stance, the Syriza party enjoyed an approval rating of 80 percent heading into this meeting. The wheelchair-bound German finance minister, Wolfgang Schauble, warned that the "Greeks certainly will have a difficult time to explain the deal to their voters."
But for now, at least, the threat of a "Grexit" has been ameliorated.