Well sometimes that happens with Swim bladder which is basically constipation. However, that usually is more common for gold fish. You could try and feed a skinned crushed pea to see if that helps the digestion system.
The other possibility is that your fishes organs are failing. I've had this happen after an internal parasite infection and sadly, this is the last stage before the fish dies. Organs start to fail which includes the swim bladder. There's not much you can do at this point.