TX power strategy based on SNR

I have two Lora devices communicating between each other. Within the packet between each device i am sending the current TX-power of the sender and the SNR of the last message sent from the other device.
From this information i want to design a dynamic strategy to negotiate a lowest TX-power that will still keep the devices connected. Is there a formulae?

You could look at the recommended algorithm that Semtech publishes for ADR