Let's suppose you have 17k gold in your account before starting a 2 player match and then you started the match with bet amount as 10k gold. This 10k gold will be deducted from your account which means your total gold would become 17k-10k=7k in your account.
If you win the match then you will get 20k gold and your total gold would become 7k+20k= 27k.
If you lose the match then you will have 7k in your account.