By tapping on the "Refill stock" button you can refill all your resource stocks in the chosen castle at the cost of some gold coins. This function is limited by a cooldown timer and can not be used perpetually.
The timer will show when you can use this function again.
The gold required for this action depends on the amount of resources. The more resources are gained, the higher the costs will be. The price for refilling 1 to 500 units of resources equals 25 gold coins, refilling 501 to 1000 units will cost 50 gold coins, and so on and so forth.