Nossie covered it

It is probably swim bladder disease which could be caused by a poor diet and/or bad water quality. Feel lucky you are being given prober advice, when I was much younger and less experience I had a fantail with a slight swim bladder problem, I was told to stop feeding it flakes and instead feed him sinking pellets. That was correct advice but I also needed to know much more! If I did the fish could have still been alive today
