Lost protected gold

When I shut the game down I had 800k gold. About 8 hours later I come back and have 38k. My treasure chest is maxed, 1 million gold protection. I had around 34 attacks. Why wasn’t my gold protected?