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