Spelling Rules - oi /oy
There are two spelling for the /oi/ sound. Oi as in boil and oy as in boy. Oi is usually in the middle of the word and oy is usually at the end of the “word.” One might wonder about words like royal and loyal, but technically oy comes at the end of a syllable and therefore oy is correct.
So, in the words where you have a vowel after [oi] sound, it has to be y like in roy-al. Also if it is not a vowel but a consonant blend which goes with the next vowel sound, like in oy-ster.