Take out SPT out of you auto-switching: if you don't do it right - you will just waste your user's hashes.
As far as I know, you take profitability out of coinchose, and coinchose is never accurate about spots when difficulty is low for the reason that it takes difficulty of the already found block and not the block which is currently mined and there is a delay as well. For spt, retargeting is done every other block, so even if you take difficulty from the client directly (using getwork command), and make your own calculations of profitability, you will only be right in 50% of the time and almost never when difficulty is low. Block time for SPT is 70 seconds, but it has wild swings up and down and you won't be able to catch a low difficulty periods accurately, and you will end up mining it when it is not profitable.
I know what I'm talking about: check my signature
Couldn't help but laugh at the last line.
1. Not using coinchoose as of two weeks ago, we have our own version
2. We don't make decisions based on simply profitability rating.
3. And the diff values are not calculated using the getwork command.
Where do you get the difficulty of the coins? It was a mistype on my part when I said: "getwork", I meant to say: "getdifficulty". Both "Getdifficulty" or "getinfo" commands of the client would return you difficulty of the already found block and not block which is currently mined by the network.
getmininginfo. Mining SPT for a couple minutes when its difficulty has increase a trivial or nontrivial amount is the last of my worries, especially when the pool hashrate increases and SPT becomes a less viable coin for our diff.
"getmininginfo" command has the same problem as "getdifficulty" and "getinfo" commands. It could be hours before you detect correct difficulty on the next block found by the network.
Here is an example for you:
Block x: Difficulty is switching to 1 from 5 (you would still see difficulty as 5 by using getmininginfo command)
Block x+1: Difficulty is still 1 (Spots are doing re-target every other block). At this point you would detect the difficulty change, but the entire network is already mining with low difficulty and your pool just switching to it now with several seconds delay.
Block x+2: Actual Difficulty is jumping back to 5 because previous 2 blocks were found much faster than target 140 seconds, but you still see the difficulty as 1 until another block with high difficulty is found.
Block x+3. At this point you would only see that difficulty actually jumped to 5.
So during this switch, you would end up mining at difficultly 5 90% of the time and only 10% at low difficulty 1.
Take a look at spot Difficulty chart and see how it behaves.
Edit: So, your strategy of getting difficulty from "getmininginfo" command is fine for any coin but SPT, because all other coins have more than 2 blocks between retarget.