Swimming in circles -- particularly in a jerky, darting motion -- usually means a goldfish has ammonia poisoning. If you see this symptom, you can take several steps to immediately address the poisoning in the short term. In the longer term, you have to take several steps to prevent ammonia from building up and harming your pet goldfish.
Goldfish may swim in circles for a couple of reasons. For example, if you keep goldfish in a bowl, they may cruise in a circular motion. But if goldfish suffer from ammonia/nitrite poisoning, it will not be a smooth, sedate motion. Goldfish suffering from ammonia poisoning will typically move in rapid, darting motions that look like the fish are panicking. Keep in mind that goldfish do not thrive in small bowls; goldfish do best in aquariums of at least 30 gallons' capacity per goldfish.
All fish, including goldfish, produce ammonia as a biological waste. Ammonia is a toxic, nitrogen-based organic compound. In the aquarium, bacteria break ammonia down into other compounds. The bacteria break ammonia into nitrite, which is still somewhat toxic, then into harmless nitrogen compounds. In an established aquarium, this process happens so fast that you cannot detect ammonia or nitrite in the water. However, in new aquariums -- or when something goes wrong -- ammonia and nitrite can build up and poison your goldfish, causing a variety of symptoms, including swimming in rapid circles.
Other Symptoms of Ammonia Poisoning
Not all fish with ammonia poisoning will swim in circles. Ammonia poisoning causes a wide variety of symptoms, including rapid breathing, lethargy and "gasping" at the surface. If you see your fish rapidly swimming in circles or any of these other symptoms, test your water for ammonia and nitrite. Neither compound should not occur at detectable levels. If you have detectable ammonia or nitrite, begin treating the aquarium.
In the short term, you need to take a couple of immediate steps. First, stop feeding your goldfish. This makes them produce less ammonia. You should also aerate the water, with either an air pump or a water pump, since ammonia makes it harder for goldfish to get oxygen from the water. Then, preform a water change. After all of this, test the aquarium water for ammonia and nitrite. Repeat the process until the levels are at or near 0 ppm for both ammonia and nitrite. If the levels stay at zero, you can begin feeding again, sparingly.
The nitrogen cycle controls ammonia in aquariums over the long term. In this process, bacteria break ammonia down into nitrite, then nitrate. Typically, it takes four to six weeks for this process to work, assuming you have not overstocked your aquarium. In order for goldfish to thrive, you need to give them room. A goldfish needs at least 30 gallons of aquarium or pond volume per fish. While goldfish will survive with less space, they will not thrive. Goldfish can tolerate poor conditions but in them will not live their full life span or reach full size. A healthy goldfish can live more than a decade and grow longer than 12 inches.
Other Sources of Ammonia
In addition to overstocking, ammonia can enter an aquarium several other ways. If you overfeed your goldfish, the extra food will rot and produce ammonia. Additionally, if a fish dies in your tank, it can rot, producing ammonia. Always remove dead fish immediately to prevent this. Last, live aquarium plants can decay and produce ammonia if not kept under ideal conditions. With hard-stemmed plants, like Amazon swordplants, their harder stems may conceal rot until it is advanced.