We're working on a smart contract in which certain transactions are executed every time a certain token price point is crossed. Therefore, if in a given instant the price crosses a set point more than 10 times, we don't wanna execute every transaction and pay transaction and gas fees. It would make sense only to execute the last transaction in every instant of time (say every 4 hours). Is there a way to do this in the smart contract or Metamask integration level so that all the redundant preceding transactions are cancelled and only the latest transaction in a given instant of time is executed?
We also wanna make sure that at the time of execution, the transactions happen with original values and not the new ones that were updated in the timespan following the original transaction creation.