Hi, Carles!
Thx a lot for recent changes.
I'm testing it and captured one issue, look at the screenshot.
There was only one trade but tons of rows were put into the table.

what market is this on bitfinex?
did you run make latest?
This is TRX market.
i've made a pure installation from scratch.
New image :)
How i've been able to sell more than i bought?

Seems that the problem is in the partially filled orders that is not cancelling for now but updating instead.
Some new logs:
> 05/11 00:42:26.069841 DEBUG OG updateASK id 1743298964: 0.40000000 BTC at price 9108.50000000 USD.
> 05/11 00:42:26.069934 DEBUG OG updateASK id 1743298964: 0.40000000 BTC at price 9108.50000000 USD.
> 05/11 00:42:26.120203 DEBUG OG updateASK id 1743298964: 0.40000000 BTC at price 9108.50000000 USD.
> 05/11 00:42:26.121651 DEBUG OG reply 1743298964::11951283935 [1]: 0.40000000/0.00000000 at price 9108.50000000.
> 05/11 00:42:26.121677 DEBUG OG saved ASK id 1743298964::11951283935 [1]: 0.40000000 BTC at price 9108.50000000 USD.
> 05/11 00:42:26.121687 DEBUG OG memory 1.
> 05/11 00:42:26.121758 DEBUG OG reply 1743298964::11951283935 [1]: 0.40000000/0.00000000 at price 9108.50000000.
> 05/11 00:42:26.121778 DEBUG OG saved ASK id 1743298964::11951283935 [1]: 0.40000000 BTC at price 9108.50000000 USD.
> 05/11 00:42:26.121787 DEBUG OG memory 1.
> 05/11 00:42:26.173439 DEBUG OG reply 1743298964::11951283935 [1]: 0.40000000/0.00000000 at price 9108.50000000.
> 05/11 00:42:26.173488 DEBUG OG saved ASK id 1743298964::11951283935 [1]: 0.40000000 BTC at price 9108.50000000 USD.
> 05/11 00:42:26.173499 DEBUG OG memory 1.
> 05/11 00:42:26.446112 DEBUG OG updateASK id 1743298964: 0.40000000 BTC at price 9108.70000000 USD.
> 05/11 00:42:26.446195 DEBUG OG updateASK id 1743298964: 0.40000000 BTC at price 9108.70000000 USD.
> 05/11 00:42:26.446250 DEBUG OG updateASK id 1743298964: 0.40000000 BTC at price 9108.70000000 USD.
> 05/11 00:42:26.446301 DEBUG OG updateASK id 1743298964: 0.40000000 BTC at price 9108.70000000 USD.
> 05/11 00:42:26.446350 DEBUG OG updateASK id 1743298964: 0.40000000 BTC at price 9108.70000000 USD.
> 05/11 00:42:26.446398 DEBUG OG updateASK id 1743298964: 0.40000000 BTC at price 9108.70000000 USD.
> 05/11 00:42:26.446446 DEBUG OG updateASK id 1743298964: 0.40000000 BTC at price 9108.70000000 USD.
> 05/11 00:42:26.446494 DEBUG OG updateASK id 1743298964: 0.40000000 BTC at price 9108.70000000 USD.
> 05/11 00:42:26.446541 DEBUG OG updateASK id 1743298964: 0.40000000 BTC at price 9108.70000000 USD.
> 05/11 00:42:26.446588 DEBUG OG updateASK id 1743298964: 0.40000000 BTC at price 9108.70000000 USD.
> 05/11 00:42:26.496874 DEBUG OG updateASK id 1743298964: 0.40000000 BTC at price 9108.70000000 USD.
> 05/11 00:42:26.507127 DEBUG OG reply 1743298964::11951283935 [1]: 0.40000000/0.00000000 at price 9108.70000000.
> 05/11 00:42:26.507165 DEBUG OG saved ASK id 1743298964::11951283935 [1]: 0.40000000 BTC at price 9108.70000000 USD.
> 05/11 00:42:26.507175 DEBUG OG memory 1.
> 05/11 00:42:26.507254 DEBUG OG reply 1743298964::11951283935 [1]: 0.40000000/0.00000000 at price 9108.70000000.
> 05/11 00:42:26.507272 DEBUG OG saved ASK id 1743298964::11951283935 [1]: 0.40000000 BTC at price 9108.70000000 USD.
> 05/11 00:42:26.507281 DEBUG OG memory 1.
> 05/11 00:42:26.507342 DEBUG OG reply 1743298964::11951283935 [1]: 0.40000000/0.00000000 at price 9108.70000000.
> 05/11 00:42:26.507358 DEBUG OG saved ASK id 1743298964::11951283935 [1]: 0.40000000 BTC at price 9108.70000000 USD.
> 05/11 00:42:26.507367 DEBUG OG memory 1.
> 05/11 00:42:26.517245 DEBUG OG reply 1743298964::11951283935 [1]: 0.40000000/0.00000000 at price 9108.70000000.
> 05/11 00:42:26.517278 DEBUG OG saved ASK id 1743298964::11951283935 [1]: 0.40000000 BTC at price 9108.70000000 USD.
> 05/11 00:42:26.517289 DEBUG OG memory 1.
> 05/11 00:42:26.517356 DEBUG OG reply 1743298964::11951283935 [1]: 0.40000000/0.00000000 at price 9108.70000000.
> 05/11 00:42:26.517374 DEBUG OG saved ASK id 1743298964::11951283935 [1]: 0.40000000 BTC at price 9108.70000000 USD.
> 05/11 00:42:26.517383 DEBUG OG memory 1.
> 05/11 00:42:26.517447 DEBUG OG reply 1743298964::11951283935 [1]: 0.40000000/0.00000000 at price 9108.70000000.
> 05/11 00:42:26.517464 DEBUG OG saved ASK id 1743298964::11951283935 [1]: 0.40000000 BTC at price 9108.70000000 USD.
> 05/11 00:42:26.517471 DEBUG OG memory 1.
> 05/11 00:42:26.517541 DEBUG OG reply 1743298964::11951283935 [1]: 0.40000000/0.00000000 at price 9108.70000000.
> 05/11 00:42:26.517556 DEBUG OG saved ASK id 1743298964::11951283935 [1]: 0.40000000 BTC at price 9108.70000000 USD.
> 05/11 00:42:26.517565 DEBUG OG memory 1.
> 05/11 00:42:26.517645 DEBUG OG reply 1743298964::11951283935 [1]: 0.40000000/0.00000000 at price 9108.70000000.
> 05/11 00:42:26.517660 DEBUG OG saved ASK id 1743298964::11951283935 [1]: 0.40000000 BTC at price 9108.70000000 USD.
> 05/11 00:42:26.517669 DEBUG OG memory 1.
> 05/11 00:42:26.517733 DEBUG OG reply 1743298964::11951283935 [1]: 0.40000000/0.00000000 at price 9108.70000000.
> 05/11 00:42:26.517749 DEBUG OG saved ASK id 1743298964::11951283935 [1]: 0.40000000 BTC at price 9108.70000000 USD.
> 05/11 00:42:26.517759 DEBUG OG memory 1.
> 05/11 00:42:26.517828 DEBUG OG reply 1743298964::11951283935 [1]: 0.40000000/0.00000000 at price 9108.70000000.
> 05/11 00:42:26.517843 DEBUG OG saved ASK id 1743298964::11951283935 [1]: 0.40000000 BTC at price 9108.70000000 USD.
> 05/11 00:42:26.517851 DEBUG OG memory 1.
> 05/11 00:42:26.553736 DEBUG OG reply 1743298964::11951283935 [1]: 0.40000000/0.00000000 at price 9108.70000000.
> 05/11 00:42:26.553777 DEBUG OG saved ASK id 1743298964::11951283935 [1]: 0.40000000 BTC at price 9108.70000000 USD.
> 05/11 00:42:26.553787 DEBUG OG memory 1.
> 05/11 00:42:26.833561 DEBUG OG updateASK id 1743298964: 0.40000000 BTC at price 9108.40000000 USD.
> 05/11 00:42:26.866042 DEBUG OG reply 1287538132:: [3]: 0.00000000/0.00000000 at price 0.00000000.
> 05/11 00:42:26.888537 DEBUG OG reply 1743298964::11951283935 [1]: 0.40000000/0.00000000 at price 9108.40000000.
> 05/11 00:42:26.888579 DEBUG OG saved ASK id 1743298964::11951283935 [1]: 0.40000000 BTC at price 9108.40000000 USD.
> 05/11 00:42:26.888589 DEBUG OG memory 1.
> 05/11 00:42:26.905066 DEBUG OG updateASK id 1743298964: 0.40000000 BTC at price 9108.70000000 USD.
> 05/11 00:42:26.906283 DEBUG OG reply 1779207848::11951284234 [1]: 1000.00000000/0.00000000 at price 2.17930000.
> 05/11 00:42:26.906333 DEBUG OG reply 1779207848::11951284234 [1]: 1000.00000000/0.00000000 at price 2.17930000.
> 05/11 00:42:26.906372 DEBUG OG reply 1779207848::11951284234 [1]: 1000.00000000/0.00000000 at price 2.17930000.
> 05/11 00:42:26.916513 DEBUG OG reply 1779207848::11951284234 [1]: 1000.00000000/0.00000000 at price 2.17930000.
> 05/11 00:42:26.955191 DEBUG OG updateASK id 1743298964: 0.40000000 BTC at price 9108.70000000 USD.
> 05/11 00:42:27.005315 DEBUG OG updateASK id 1743298964: 0.40000000 BTC at price 9108.70000000 USD.
> 05/11 00:42:27.024398 DEBUG OG reply 5268657913:: [3]: 0.00000000/0.00000000 at price 0.00000000.
> 05/11 00:42:27.030881 DEBUG OG reply 1743298964::11951283935 [1]: 0.38780348/0.01219652 at price 9108.40000000.
**> 05/11 00:42:27.030937 GW BITFINEX TRADE SELL 0.0121965 BTC at price 9108.4 USD (value 111.091 USD).**
> 05/11 00:42:27.031011 DEBUG OG saved ASK id 1743298964::11951283935 [1]: 0.38780348 BTC at price 9108.40000000 USD.
> 05/11 00:42:27.031022 DEBUG OG memory 1.
> 05/11 00:42:27.031119 DEBUG OG reply 1743298964::11951283935 [1]: 0.38780348/0.01219652 at price 9108.70000000.
**> 05/11 00:42:27.031145 GW BITFINEX TRADE SELL 0.0121965 BTC at price 9108.7 USD (value 111.094 USD).**
> 05/11 00:42:27.031202 DEBUG OG saved ASK id 1743298964::11951283935 [1]: 0.38780348 BTC at price 9108.70000000 USD.
> 05/11 00:42:27.031213 DEBUG OG memory 1.
> 05/11 00:42:27.062781 DEBUG OG reply 6735131827:: [3]: 0.00000000/0.00000000 at price 0.00000000.
> 05/11 00:42:27.103834 DEBUG OG reply 1743298964::11951283935 [1]: 0.40000000/0.01219652 at price 9108.70000000.
**> 05/11 00:42:27.103885 GW BITFINEX TRADE SELL 0.0121965 BTC at price 9108.7 USD (value 111.094 USD).**
> 05/11 00:42:27.103955 DEBUG OG saved ASK id 1743298964::11951283935 [1]: 0.40000000 BTC at price 9108.70000000 USD.
> 05/11 00:42:27.103969 DEBUG OG memory 1.
> 05/11 00:42:27.123631 DEBUG OG reply 1775623997::11951285850 [1]: 4.00000000/0.00000000 at price 221.09000000.
> 05/11 00:42:27.123702 DEBUG OG reply 4679017240::11951285851 [1]: 1.50000000/0.00000000 at price 736.80000000.
> 05/11 00:42:27.133280 DEBUG OG reply 1743298964::11951283935 [1]: 0.40000000/0.01219652 at price 9108.70000000.
**> 05/11 00:42:27.133322 GW BITFINEX TRADE SELL 0.0121965 BTC at price 9108.7 USD (value 111.094 USD).**
> 05/11 00:42:27.133389 DEBUG OG saved ASK id 1743298964::11951283935 [1]: 0.40000000 BTC at price 9108.70000000 USD.
Still having this issue!
The issue still here! Lets open the case again.
It seems like everything about this program is broken - I'm having this too. And ping-pong still not working, and I think the mean and std devs are broken too. I think it may be scrap and restart time
I have everything working except this issue :)