Skip to main content

FeeReferral

FeeReferral

User referrals for Domination Finance exchange

Tracks referrals. Grants discounted trade fees to users who submit a referral code, and redirects part of their trade fees to the referrer.

Addresses

ChainAddress
Arbitrum Sepolia0x01eADD24c68f64E9DcCdD61F67eAE8Ccb03BD355

Functions

setReferrerRedirect

function setReferrerRedirect(address referrer, FPUnsigned redirect) external

setReferrerFeeDiscount

function setReferrerFeeDiscount(address referrer, FPUnsigned discount) external

setPerp

function setPerp(contract IDomFiPerp perp) external

setReferrer

Register an address as user's referrer. The caller must either be user or their manager as returned by DomFiPerp.isManagerFor. Reverts if user's referrer has already been set.

function setReferrer(address user, address referrer) external
Dev note

Only the administrator can reset a fee referral that has already been set.

Parameters

NameTypeDescription
useraddressThe user who wishes to redeem someone's referral code
referreraddressAn address that referred them to Domination Finance

getReferrerDiscount

Get the fee discount applied to everyone who signed up using referrer's code.

function getReferrerDiscount(address referrer) external view returns (FPUnsigned)
Dev note

Used by FeeCalculator to compute fees. Applies before any redirect.

Parameters

NameTypeDescription
referreraddressAddress that referred another user

Return Values

NameTypeDescription
[0]FPUnsigned

getReferrerRedirect

Get the fraction of fees that should be redirected to referrer from everyone they've referred.

function getReferrerRedirect(address referrer) external view returns (FPUnsigned)
Dev note

Used by FeeDistributor when distributing trade fees. Applies to whatever fees remain after the discount.

Parameters

NameTypeDescription
referreraddressAddress that referred another user

Return Values

NameTypeDescription
[0]FPUnsigned

Events

ReferrerRedirectSet

event ReferrerRedirectSet(address referrer, FPUnsigned redirect)

ReferrerSet

event ReferrerSet(address user, address referrer)

ReferrerFeeDiscountSet

event ReferrerFeeDiscountSet(address referer, FPUnsigned discounts)

Errors

RedirectFractionAboveMax

error RedirectFractionAboveMax()

DiscountAboveMax

error DiscountAboveMax()

InvalidPerp

error InvalidPerp()

ReferrerAlreadySet

error ReferrerAlreadySet()

Unauthorized

error Unauthorized()

SelfReferral

Users cannot register as their own referrers.

error SelfReferral()

Variables

referrerOf

Get the registered referrer of an account.

Parameters

NameTypeDescription

Return Values

NameTypeDescription

domFiPerp

referrerDiscounts

MAX_REFERRER_TRADE_DISCOUNT

DEFAULT_REFFERER_TRADE_DISCOUNT

referralRedirect

MAX_REFERRER_REDIRECT

DEFAULT_REFERRAL_REDIRECT