Any idea how the After Match Grade system works?

I’m a pretty bad/new player and I was curious if anyone has managed to figure out how the game determines your grade after a fight. I usually end up getting around AEC or ADD (though I usually LOSE the match, no joke I’m at 5% win/lose ratio on ranked at the moment)

I don’t think that the offense is based on damage, or how often your hits connect because I’ve gotten good grades before when I’ve barely done any damage.