SWIM BLADDER DISEASE
The swim bladder is an air-filled organ which the fish uses to balance itself and swim up and down by regulating the pressure inside. If the airbladder becomes compressed, deformed or diseased the fish cannot regulate it and therefore 'loses its balance'. Fancy goldfish frequently suffer with SB problems due to their compressed body shapes; the cause may therefore be internal physical deformity. Other causes are constipation - which compresses the SB - gulping air whilst feeding at the surface or eating food with too much air inside, such as dry floating foods, Fatty Liver Disease or kidney cysts. Bacterial or internal parasitcial infections can also be involved, and egg impaction in female fish is an occasional cause. High nitrates have also recently been found to cause SBD.
A fish develops Swim Bladder Disorder (SBD) when something is pressing on his swim bladder, and screwing with his ability to control where he is between the bottom and the surface in the water column.
There are two symptoms for SBD, one is floating, swimming sideways or upside down (the belly is trying to turn upwards) and a difficulty swimming to the bottom. The other is perpetual sinking, lying on the bottom, and swimming tail down with difficulty getting to the surface.
Unless the SBD is caused by an internal infection of the digestive tract (which happens very, very rarely), there is no medicine for it. An infection would be treated with antibiotics.
In most fish, SBD is caused most often by overfeeding or overfeeding of bloodworms (which should be a treat, not a staple), and less often by the fish having a blocked digestive tract or constipation. All causes result in pressure placed on the fish's swim bladder from a bloating of the digestive tract. Where the bloating occurs determines if the pressure will cause floating or sinking. Either way, the treatment is the same.
Before you can presume an infection, you have to rule out the more common possibilities.
The first thing you do is fast the fish. If your problem is overfeeding, it may take up to 3 days of fasting for the food to all have passed and the fish to swim normally again. If it is a blockage or constipation, it could take longer. If the fish shows no improvement by the 3rd day, feed it a small bit of thawed and shelled frozen pea. This serves to scrub the digestive tract and loosen constipation. If the fish refuses to eat, it may be that it is still too full to feel hungry, or you could try a bit of freeze-dried daphnia. Most fish will not refuse daphnia unless there is a problem, so if it turns its nose up at that, then you need to continue to fast it and try again the next day.
If it eats the pea or daphnia, give it a few days before feeding it anything more.
While there is no improvement, you should fast it 3 days between feedings of peas or daphnia (feeding every 4th day). When it shows improvement, you can shorten the time between feedings. Don’t go back to regular food until it is acting normally again.
It can take as long as 2 weeks for your fish to show improvement (I know, I had a female betta take that long).
If your fish shows signs of worsening during any of this, or if it shows no improvement in 2 weeks, it is safe to presume an internal bacterial infection. Any antibiotic recommended for this is fine. Follow package directions. I would continue to feed it only every 2 or 3 days during treatment so as not to stress the digestive tract while it's healing.