Based on the coinmarket cap api, how do they calculate the bitcoin percent change
Well, you have all the information you need:


Compute the price of your coin 24h ago (in USD)
Get the price of the bitcoin 24h ago (in USD)
Compute how much bitcoin your coin was worth in BTC 24h ago using the two previous results
Compare with the current BTC value of your coin


Done :)