I m thinking the amount of troops I lose is base on total troops I have. It seem I lose almost same win or lost.
You lose more on a loss, and depending on defenders strength and ally bonus for overall loss win or lose. Don't know formula andnit would be hard to figure out as not many people are willing to share ally bonuses