Stocks on Wall Street ended higher, recovering the most of their losses from the day before, as Greece appeared closer to resolving its latest debt issues.
However, the overall market remains directionless as most investors are focused on figuring out when the Federal Reserve's long-awaited interest rate increase may come.
The Dow Jones industrial average rose 121.45 points, or 0.7%, to 18,162.99 yesterday. It had fallen 190 points on Tuesday.
The Standard & Poor's 500 index rose 19.28 points, or 0.9%, to 2,123.48 and the Nasdaq composite rose 73.84 points, or 1.5%, to 5,106.59.
The stock market was barely higher for the first half of the day, but gained momentum in the afternoon after Greece's prime minister Alexis Tsipras said his country is near a deal with its creditors.
Mr Tsipras stressed that "calm and determination" were needed in the final stretch of negotiations.
Greece might miss a debt payment on June 5 if it fails to receive bailout funds from creditors, who are demanding that the country make reforms to its economy.
It is unclear whether an agreement can be reached in time and Greece is dealing with three different creditor institutions - the International Monetary Fund, European Commission and European Central Bank.
Missing those payments could destabilise the country's financial system and eventually push it out of the 19-country eurozone, a step that could shake the currency union and the global economy.
The news helped the euro stabilise against the dollar after its sell-off on Tuesday. The drop in the euro was partially blamed for Tuesday's stock market sell-off.
Apart from Greece and the dollar, most of investors' attention is on the Fed and when the central bank plans to start raising rates for the first time in almost a decade.
Investors and strategists are split on when the central bank will move, with some thinking it could be as early as September and most looking at early 2016.
Market strategists argue that until the market has some more clarity from the Fed or from economic data, stocks are unlikely to post solid gains. There was no major economic data yesterday to move the market one way or another.
"It's an old but true expression: the market likes certainty. Until we get that from the Fed, stocks are unlikely to make any headway," said David Lefkowitz, a senior equity strategist at UBS.
In individual stocks, tobacco companies Lorillard and Reynolds American rose after the Federal Trade Commission gave its tacit approval to the companies' $27.4bn merger.
Lorillard, maker of Newport cigarettes, was up 70 cents, or 1%, to $72.82. Reynolds American, which makes Camel cigarettes, was up $1.70, or 2.3%, to $77.13.
Michael Kors Holdings sank $14.66, or 24%, to $45.93. The handbag and accessories maker posted a drop in year-over-year sales and predicted sales would be well short of analysts' estimates.
And jewellery maker Tiffany & Co rose $9.01, or 11%, to $94.54 after its quarterly results topped analysts' expectations, despite a stronger dollar.
Benchmark US crude fell 52 cents to $57.51 a barrel on the New York Mercantile Exchange. Brent crude fell $1.66 to $62.06 a barrel in London.
In the bond market, U.S. government bond prices edged higher. The yield on the 10-year Treasury note fell to 2.13% from 2.14% the day before
Precious and industrial metals futures ended lower. Gold lost $1.30 to $1,185.60 an ounce, silver fell 10 cents to $16.65 an ounce and copper fell a penny to $2.77 a pound.