That's the commonly accepted advice.
Keep nitrAtes low
soak all pellets/flakes before feeding.
Fast and feed fresh veggies... usually peas.
I think that feeding exclusively pellets/flakes is not healthy for goldies as those contain mostly highly processed protein and fast carbs (some of which contain undigestable starches that may cause gas).
I think the best preventative for bouyancy issues is a healthy diet that includes daily veggies (e.g. green beans, peas, lima beans, zucchini, etc), and fresh protein (e.g. shrimp, redworms, daphnia, krill, etc).
The first thing I'd do if a goldie flipped would be to feed a big meal of fresh foods to push whatever's causing the gas out of the GI tract. I'd stop feeding whatever was fed just prior to the flipping. I'd also switch to
homemade gel food with added acidophilus to try and remove the source of the gas and change the flora in the GI tract.