Added a helper min(...) function that accepts None.
Removed unused code.
Avoid processing the same trade twice when its received both throught the public and private channel.