End node SF allocation

I have developed a SNR based SF allocation algorithm. Now i would like to implement the algorithm for SF allocation, how should it be implemented on server/gateway side?

That would somethings that is part of the backend code, specifically the ADR code. You will need to run your own backend for it or convince TTN to include it in their code. Keep in mind LoRaWAN has strict standards for gateway to node communication, a downlink must match the nodes expectation or the node will not receive it.

The the only thing that you can easily change without causing issues is the node to gateway part as that is something you can implement yourself on the node, however there you won’t have much data available to base your calculations on as a node is allowed only receive 10 downlinks a day in TTN (including acknowledgements on confirmed uplinks).