Dynamic taxation feature, I need advice

In order to become the coolest guy and limit the likely price increase that is based on hype, I need a dynamic tax in the smart contract of the token that works on any DEX exchange. That is, there is no binding to a separate exchange. For example, an intraday price increase above 1% is taxed at 1%, an intraday price increase of 2% is taxed at 2%, so up to 10% the maximum allowable tax is 10%. And most importantly, the tax should be added only when buying, when selling, no tax is added.
So the question is how to do it?
But this feature should not go into gold at a price, can it be tied up with free oracles?
And most importantly, this function should not be vulnerable, that is, the theoretical one should not even be vulnerable, and should not create other vulnerabilities.
Or would you advise not to set a dynamic tax?
Instead, set the usual tax function on any transfer of tokens?

There are several examples online, just look at several sources for inspiration like here