For fancy varieties, you still need a 4ft tank as a minimum, as I said here:For common goldfish, yes. They're a normal shaped fish that is fairly active. I've been referring to "fancy" goldfish (ryukin, oranda, ranchu, moors, butterflies, etc) as they're eternally dopey fish that aren't really active lol
It is recommended to have at least 120×45×45 cm (4×1.5×1.5 ft) for fancy goldfish
A 40g breeder is only a 3ft tank.