Attackers can steal up to 50% of your gold, depending on how well they pass your dungeon and whether they have a Steal Gold Bonus or not. The amount of gold which you have in your golden mine is also counted towards your total gold and attacker is able to steal it as well.