How long has the goldfish been in this condition?
floating upside down every now and then for a week or so. Now he cant really even swim, just floating upside down
The condition your fish has is called Swim Bladder Disorder (sbd) which is obviously a disorder that affects a fish's swim bladder. The swim bladder is responsible for a fish being able to swim upright and maintain its buoyancy. When it becomes blocked, infected or too full of air it ceases to function properly as you are witnessing with your fish.
Many types of goldfish are highly susceptible to this disorder mainly because of the odd shapes of some species, genetics and poor breeding practices.
There really does not exist a fool-proof way to prevent sbd but by maintaining excellent water conditions and soaking flake food prior to feeding can lower the prevalence of the disorder. The reason for soaking flake food, prior to feeding, in tank water set aside, is that the flakes will absorb water thus lessening the amount of air the fish intakes when gulping the food
The traditional way to treat this is by isolating the affected fish in a quarantine tank, if possible, using water from the main tank so as to not change the fish's environment too much.
Once seperated begin to feed the fish canned peas without the husk. Feed 2-4 peas twice a day making sure to clean out any uneaten portions. Peas are well known to clear out a fish's swim bladder.It's best to feed the pea diet exclusively. If the pea diet does not work then try the pea diet with intermitent days of fasting.
In addition to the pea diet you can try treating the fish with a medicine called Maracyn-Two which is sometimes helpful in curing sbd as some cases are caused by bacteria. It can easily be purchased at most pet stores where fish are sold. Follow the directions on the product label for dosage amounts. For a view of Maracyn-Two, click on the 1st link below. Note: if you are located outside of the USA please let me know and I will recommend a medicine more eaily found.
It would also be helpful to not fill the quarantine tank up to the top with water leaving about 2-3 inches from the top free as this will lessen the amopunt of water pressure on the fish.
Please keep in mind that sbd can sometimes be very difficult to cure and is one of the
most common problems goldfish keepers face.
Listed below are 2 additional links which will further elaborate on sbd.
Best wishes and please let me know if you have any questions.
Frozen peas can be used instead of canned peas but it's best to thaw them a bit before feeding and also remove the husk/shell before feeding.
As for quarantining the fish--it's not absolutely necessary especially if you're going to feed peas as the other fish can eat them too without suffering any unfavorable consequences but it's the use of the medicine that makes using a seperate tank desirable.
Sometimes the use of medicine(s) will damage the biological balance of an aquarium but if you do not have an extra tank handy then there's no other choice but to treat in the main tank.
What I suggest you do is try the pea diet for 4-5 days, if no improvement is seen then begin treating with the medicine recommended earlier.