place a maximum amount of money for the bet, lets say 100k or 1000k.
If I bet 50k that id1 wins, someone else has to bet that someone else will win, if not the bet would not be valid.
So:
1) i bet 50k id1 wins
2)(nothing happens)
or
1) i bet 50k id1 wins
2) someone else bets 25k that id2 wins
3a) id1 wins, i get 25k and he looses 25k
3b) id2 wins, he gets 25k and i loose 25k
In this way, the total money in the server shouldnt change.
we could also do this:
1) i bet 50k id1 wins
2) he bets 25k id2 wins
3) she bets 25k id3 wins
4a) id1 wins, i get 50k and both loose 25k
4b) id2 wins, he gets 25k and i loose 25*(2/3)k and she looses 25*(1/3)k
4c) id3 wins, she gets 25k and i loose 25*(2/3)k and he looses 25*(1/3)k
this way if someone bets on dodger many money, nobody would bet on others. but if someone bets on me, someone would bet on someone else maybe
or make bets valid only between players with similar highscore