Has the math used during battles been determined (by the community) yet?

Ive heard two methods of figuring this out..

your atk + def vs opponet atk + def = 50% of the battle
assigned 20%, unassigned 30%.

..and

your atk vs thier def + a 20% cushion = 50% of the battle
assigned 20%, unassigned 30%.


Why the **** can I win all 3 categories and produce a loss?