I cannot work out how the game decides how much gold and elixir an opponent can steal from me. Sometimes it is around half of my total balance, while other times it seems to be a very small proportion, say around 10-20% .
Is there a formula that determines this?