Programming, yes. I have a little Python script that checks the market
It does that math to figure out the starbits/fan and finds the cheapest
It was written as an experiment for something I hope to release for everyone soon
To figure out how, I used this https://github.com/harpagon210/sscjs and looked at the network connections from the dev panel while playing Rising Star