"Traders moving forward know that the Greece situation is in control," said Todd Schoenberger, managing director of LandColt Trading. "And because it’s in control, they're looking out for the next time bomb, which is nonfarm payrolls [next Friday]."
Schoenberger added that stocks were boosted by "month-end window dressing" and portfolio tweaking by hedge fund managers ahead of the last day of the quarter Thursday.
Financials, down almost 4 percent for the year, were the leading sector today. Bank of America climbed after the firm reached an $8.5 billion settlementon investor claims over securities purchased before the housing-market collapse. Also, S&P Equity raised its rating on the stock to "strong buy" from "hold."
Rivals Citigroup , JPMorgan , Morgan Stanley and Goldman Sachs also advanced following the news and even after their price targets were cut by KBW.
Meanwhile, shares of Visa and MasterCard soared after being halted briefly following the Fed's decision to cap debit card swipe fees at a much higher levelthan earlier suggested.
Among techs, Microsoft slipped to lead the Dow laggards, a day after the software giant unveiled plans to create an online version of its popular Office program.
Meanwhile, Apple was flat amid speculation that the tech giant is expected to cut its iPhone 3GS to $0 in conjunction with its iPhone 5 launch, expected in September. According to an RBC note, the approach is intended to "target mid-market smartphone buyers" and counter Android's expansion.
BJ's Wholesale climbed after the retailer agreed to be acquired by private equity firm Leonard Green & Partnersand funds advised by CVC Capital Partners in a deal that values the company at about $2.8 billion. Meanwhile, S&P Equity cut its rating on the firm to "hold" from "buy."
On the earnings front, KB Home plunged almost 15 percent after the homebuilder reported a bigger-than-expected quarterly loss. Pulte and D.R. Horton also slipped.
Monsanto climbed after the agricultural biotechnology firm said its earnings skyrocketed, thanks to robust sales of its seeds and genetic traits business.
U.S. Steel and AK Steel rallied to lead the S&P index after Deutsche Bank raised its rating on the steelmaker to "buy" from "hold."
On the IPO front, HomeAway soared on their market debut as investors were drawn to the latest slew of Internet companies.
Meanwhile, LivingSocial met with banks this week to discuss an IPO of about $1 billion, CNBC learned. The IPO is expected to value the online coupon company at $10 billion to $15 billion.
Oil prices climbedafter a government report showed inventories fell. U.S. light, sweet crude rose $1.88 to settle at $94.77 a barrel, while London Brent crude advanced$3.62 to settle at $112.40.
Treasurys extended lossesafter the government auctioned $29 billion in 7-year notes, which had a high yield of 2.430 percent and a bid-to-cover of 2.62.
In economic news, pending home sales rose more than expected in May, according to the National Association of Realtors. However, weekly mortgage applications slipped last weekamid weakening demand, even as mortgage rates dropped, according to the Mortgage Bankers Association.
Meanwhile, President Obama said tax cuts for the wealthiest Americans must be endedas part of a deficit deal, which he said he believed Republicans and Democrats would reach. (Watch: Reaction to Obama's Speech)
European shares hit their highest close in two-weeksfollowing the Greek vote.
On Tap This Week:
THURSDAY: Weekly jobless claims, Fed's Bullard speaks, Chicago PMI, End of QE2, Marathon Oil split takes place
FRIDAY: Consumer sentiment, ISM mfg index, construction spending, Biden's deadline for deficit plan, HP launches TouchPad, auto sales
More on CNBC.com