How is sr gains and losses calculated in Diamond+

Hello, I just climbed up to diamond a week ago and was wondering how sr gains and losses were calculated as it seems somewhat random. In plat, it would make some sense as on games where I played worse I’d get less and lose more etc. But now I’ll randomly lose like 25 sr one game and then lose 19 the next regardless of what I do ingame. If it’s based off of wins/losses shouldnt they be even to each other? Does anybody have insight as to how its calculated or is it just a big mystery?

You can look at How Competitive Matchmaking and Rating Works (Season 20) to see all the things that can affect SR gains. Performance SR turns off in diamond+, but there are still many other factors.