Tips on beating it
Only buy things that give you speed/agility. This game is classified as a 'shooter' but really it's an 'avoid' game.
You never need to aim, so to beat it you simply have to put 100% of your attention on avoiding bullets since you have very limited health.
By not upgrading your cannon, it makes the levels last longer so you can collect more treasures which actually means more money.
You have unlimited range, so the best strategy is to just outlast the monsters and go around the outside of the level, only picking up gold from the treasure chests. Don't bother getting gold from ships because the risk of getting hit by a bullet is too high.
The second boss is much much harder than the final boss. You pretty much need to have all your money in things that give speed and have not lost any heath until then to beat boss 2.
Spoiler: Also, when the final boss dies, don't go on top of his body like you can the other bosses to pick up the money. He spawns another boss which will kill you by touching it rather than giving you money. This is a bad UI decision on the part of the developers IMO.