There’s a gold forge at the bottom of each level. The forge generates gold constantly - it’s your main source of income at the start of every stage. It’s handy when the first mineshafts are not automated and guarantees a minimum income even when idle.
The spinning yellow bar indicates the forge’s work cycle: you get coins with each completed spin. The number of gold created by the forge on each spin is shown at the top of the building.
You can spend some coins to upgrade the forge and increase the amount of gold it generates. To do that, press the green button near the forge. (if the button is grey, you don’t have enough coins right now).
See also: My forge stopped working!