I've had my betta for a few months now. I keep him in a 1.8-gallon tank and change his water at least once per week. The water is still and has a heater set at 79 degrees F. He got bad fin rot about a week after I got him. I use atison's betta spa (5ml) when I change his water, and also bettasafe water conditioner. I sometimes add a couple drops of melafix. Lately he has been randomly squirming and swimming like crazy and bumping into all the walls and then instantly stopping at the bottom and not moving for a while. Just now he did that and his scales lost about half of their color and he seems really pale and when he stopped, he was facing upwards at the surface. What is wrong? He is really lively and squirms against the glass when I come in the room, but after a while his twitching and spasms come back.

Did it start after adding the melafix? If so, do an immediate 100% change and see if that helps him.

It's best not to have medication in the tank regularly since it does more harm than good. Melafix is generally not the best medication for a betta either since it contains Tea Tree Oil, which harms their labyrinth organ.

I would remove him, do a 100% water change, then acclimate him to the new water slowly by floating his cup in the tank for 20 minutes or so, removing some water from the cup and replacing it with water from the tank. When he is acclimated, use a net to dump the cup water out into a bowl or the sink and place him in his tank. The medication isn't something you would want to use with him, as stated above.. especially adding in two different chemicals (not including water conditioner) such as that. Over exposure and improper water changes while using the medication may be causing him to go into shock and harming him.

Are you sure it was fin rot and not biting his tail, or tearing it on decoration? Fin rot- bacterial form is black edges that are crusty and flaking off, fungal form is white cottony patches on the edges.

Fin rot forms from when a fish tears/rips it's fin and dirty water allows the bacteria to grow in the injury..

If your tank is filtered you would want to be doing 1 50% water only and 1 50% substrate vacuuming per week to keep it clean.. if it's unfiltered you would want to do 1 50% (water only) and 1 100% water change per week- rinsing out the gravel when you do so. If your tank has live plants, let us know as the water changes are different based off of live plants.

That will help prevent rot from forming in the future.. for fin rot, if it's true fin rot then you would want to do 1 teaspoon of AQ salt pre dissolved per gallon, daily 100% water changes, don't forget the water conditioner.. normally just clean water is all that is needed (frequent water changes every other day until it is gone). Is there a way to get a picture up so we can help verify the problems?