Goldfish were domesticated around a 1000 years ago in China. Their placement in the taxonomy of the carps from that region is still under debate. At one time
Carassius auratus was thought to have two subspecies:
C. a. auratus (the domestic goldfish) and
C. a. gibelio (Prussian carp). But in my recent search of fishbase.org it appears the two have been split into separate species.
Carassius auratus auratus, Goldfish and
Carassius gibelio, Prussian carp This makes the Prussian Carp the closest wild relative to the goldfish (much as wolves are to domesticated dogs).
Wikipedia also has a rather nice article complete with ample citations on the domestication of goldfish:
Gold fish - Wikipedia, the free encyclopedia