Commission rates on affiliate orders are calculated based on a couple of factors. 

Set Commission Rates

Within your shop settings, you can set the default commission rate that affiliates will earn on each conversion. Whenever an affiliate registers with you, they will be assigned that commission rate until it is changed for that affiliate manually.

Discount Codes

Discount codes, however, take precedence to any referral and have their own commission rate assigned to them. This is to give you better control over the max payout on a sale. 

For example, if an affiliate's commission rate was 10%, and they made a referral using a discount code at 5%, your total payout would be 15% (commission plus the discount). But with this system, you can set the commission rate on a discount code to 5% to maintain your payout level of 10%. So even if an affiliate had been specifically assigned a 10% commission rate, they would only receive 5% on referrals made with that discount code.