the amount of sp you get depends on the difference between your lvl and your highest mastery lvl. that difference is called "a gap"

if your highest mastery lvl is the same as your lvl, you will get standard amount of exp and sp... with, for example, mastery 30 and lvl 31 you will get +10% sp and -10% exp, and so on... up to gap 9 (for example lvl 31 and mastery 22) which wields the maximum sp bonus (+90%) and highest exp penalty.