GNSReferrals
Facet #2: Referral system
constructor
initializeReferrals
Parameters
_allyFeeP
uint256
% of total referral fee going to ally
_startReferrerFeeP
uint256
initial % of total referral fee earned when zero volume referred
_targetVolumeUsd
uint256
usd opening volume to refer to reach 100% of referral fee
updateAllyFeeP
Updates allyFeeP
Parameters
_value
uint256
new ally fee %
updateStartReferrerFeeP
Updates startReferrerFeeP
Parameters
_value
uint256
new start referrer fee %
updateReferralsTargetVolumeUsd
Updates targetVolumeUsd
Parameters
_value
uint256
new target volume in usd
whitelistAllies
Whitelists ally addresses
Parameters
_allies
address[]
array of ally addresses
unwhitelistAllies
Unwhitelists ally addresses
Parameters
_allies
address[]
array of ally addresses
whitelistReferrers
Whitelists referrer addresses
Parameters
_referrers
address[]
array of referrer addresses
_allies
address[]
array of corresponding ally addresses
unwhitelistReferrers
Unwhitelists referrer addresses
Parameters
_referrers
address[]
array of referrer addresses
registerPotentialReferrer
Registers potential referrer for trader (only works if trader wasn't referred yet by someone else)
Parameters
_trader
address
trader address
_referrer
address
distributeReferralReward
Distributes ally and referrer rewards
Parameters
_trader
address
trader address
_volumeUsd
uint256
trading volume in usd (1e18 precision)
_referrerFeeUsd
uint256
referrer fee in USD (1e18 precision)
_gnsPriceUsd
uint256
token price in usd (1e10 precision)
claimAllyRewards
Claims pending GNS ally rewards of caller
claimReferrerRewards
Claims pending GNS referrer rewards of caller
getReferrerFeeProgressP
Returns referrer fee % progress towards earning 100% based on his volume referred (1e10)
Parameters
_referrer
address
referrer address
getTraderLastReferrer
Returns last referrer of trader (whether referrer active or not)
Parameters
_trader
address
address of trader
getTraderActiveReferrer
Returns active referrer of trader
Parameters
_trader
address
address of trader
getReferrersReferred
Returns referrers referred by ally
Parameters
_ally
address
address of ally
getTradersReferred
Returns traders referred by referrer
Parameters
_referrer
address
address of referrer
getReferralsAllyFeeP
Returns ally fee % of total referral fee
getReferralsStartReferrerFeeP
Returns start referrer fee % of total referral fee when zero volume was referred
getReferralsTargetVolumeUsd
Returns target volume in usd to reach 100% of referral fee
getAllyDetails
Returns ally details
Parameters
_ally
address
address of ally
getReferrerDetails
Returns referrer details
Parameters
_referrer
address
address of referrer