Edit: Some of this is flawed. I forgot that the wall is even cheaper than 25

when you add in stone, but you get the idea. anyway. City hammers are false too--it should be 30, not 20--but this was just an example anyway.
You get the gold the turn the wall completes. I don't understand how you do a 2-pop whip like mystyfly says because the walls only cost 25

on normal speed--it's better to construct it normally until 40+ hammers are invested and then whip. Whipping before investing into it isn't that effective.
If you have both stone and protective then;
- whip = 30+30+30 = 90 hammers
- let's say you chop 3 forests the turn you complete it = (30+30+30)+(30+30+30)+(30+30+30)= 270 hammers
- You produce 10 hammers from the city = 20 hammers
Let's say the wall was at 45/50 hammers. By doing the procedure I typed you'll get 425 hammers. 25 of them is the original cost of the wall before multipliers so we remove those as it'll get carried into the next build. 50 hammers will go into the wall itself so we remove that too. Still, we're left with 350 hammers extra which will get turned into 350

.
I guess organized religion could add even more gold, but I'm keeping it simple for clarity.