idk if anyone put this yet since I dont have the time to read all the comments but this is how I got through the first epic battle:
first is I was at lv 17 when I first got to the epic battle and I did loose but it was close (got the boss down to about 300 hp) so be 18+ at least
second is I increased my mana pool to around 5000-6000 and build towers close to the spawn points
third before the boss battle (like 2 waves before) I started to build moats close to my towers
fourth I made it so that I had pure gem colors....did not mix one color at all (which was difficult to get the right color when you create gems) its also handy to have a few gems for gem bombs to take out any big groups clump together
lastly on the upgrades I maxed the mana replenish and the max mana and mixed and matched the other available upgrades
Hope this helps the rest of you like it did to me :) good luck soldier lolz