Gold bounced back on Wednesday helped by the dollar’s slight retreat from a two-decade high and as bargain hunters took advantage of recent losses, but the precious metal’s outlook was still clouded by prospects of aggressive rate hikes.

Spot gold rose 0.9% to $1,716.59 per ounce by 2:02 p.m. ET. U.S. gold futures settled 0.9% higher at $1,727.80.

The dollar index hit a fresh 20-year high, making greenback-priced gold less attractive for overseas buyers. But a slight pullback from the peak late in the session seemed to offer some respite for gold.

David Meger, director of metals trading at High Ridge Futures, attributed gold’s moves to “a combination of a bit of safe haven demand and buying on dips,” while headwinds from the dollar and an aggressive Fed persisted.

“Gold recently has acted as a risk asset than a safe-haven. The question is when will we see gold take on more of a safe-haven role as we begin to see economies slow due to these rising rate hike policies.”

Gold prices have fallen over $300 since rising above $2,000 per ounce in March.

Data on Tuesday showed U.S. services industry picked up last month, providing ammunition to the U.S. Federal Reserve to deliver another 75-basis-point rate hike.

Higher rates increase the opportunity cost of holding non-yielding bullion.

Spot silver rose 1.9% to $18.40 per ounce.

Silver represented a buying opportunity since the price had fallen so far below its true value, with the demand outlook for the metal used in key sectors of the energy transition such as batteries still positive, Kinesis Money analyst Rupert Rowling said in a note.

Platinum gained 1.6% to $866.43 and palladium climbed 1.9% to $2,044.09.