What happens is that the goldfish consumes air and it's retained in their abdominal sections which cause them to float upside down.
It's true that soaking your commercial goldie pellets in water for about a minute helps 'coz then it doesnt expand inside the goldfish. Also, feeding them peas may prevent this from happening. (peas are good for everything! XD)
What i do is feed my goldies a varied diet plus one fasting day in a week. The peas are frozen ones from any supermarket, left out to thaw completely then squashed into goldfish bite-size pieces. I've seen my goldfish attack a much-too-large piece once and it was traumatic for me(!), watching him choke then finally spit it out. Goldfish should be fed a low protein, high carbohydrate diet that is easily digested. They cant metabolize excess protein; it makes them fat and the pollution level of yr water increases.
hope it helps.
