client.referral manages referral codes. Referrers earn a share of referred traders’ fees as claimable rebates; referred traders get a fee discount.
Register a code (as referrer)
register_code("MYCODE") is the non-gasless variant (direct calldata; you pay gas in direct mode).
Attach to a code (as trader)
Track and claim
client.info.referral_count(trader) and referred_fees(trader) give further detail.
Code administration
All take the usual
wait=True and return an ExecutionReceipt.