IReferralsUtils
Interface for GNSReferrals facet (inherits types and also contains functions, events, and custom errors)
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
_referral
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
UpdatedAllyFeeP
Emitted when allyFeeP is updated
Parameters
value
uint256
new ally fee %
UpdatedStartReferrerFeeP
Emitted when startReferrerFeeP is updated
Parameters
value
uint256
new start referrer fee %
UpdatedOpenFeeP
Emitted when openFeeP is updated
Parameters
value
uint256
new open fee %
UpdatedTargetVolumeUsd
Emitted when targetVolumeUsd is updated
Parameters
value
uint256
new target volume in usd
AllyWhitelisted
Emitted when an ally is whitelisted
Parameters
ally
address
ally address
AllyUnwhitelisted
Emitted when an ally is unwhitelisted
Parameters
ally
address
ally address
ReferrerWhitelisted
Emitted when a referrer is whitelisted
Parameters
referrer
address
referrer address
ally
address
ally address
ReferrerUnwhitelisted
Emitted when a referrer is unwhitelisted
Parameters
referrer
address
referrer address
ReferrerRegistered
Emitted when a trader has a new active referrer
AllyRewardDistributed
Emitted when ally rewards are distributed for a trade
Parameters
ally
address
address of ally
trader
address
address of trader
volumeUsd
uint256
trade volume in usd (1e18 precision)
amountGns
uint256
amount of GNS reward (1e18 precision)
amountValueUsd
uint256
USD value of GNS reward (1e18 precision)
ReferrerRewardDistributed
Emitted when referrer rewards are distributed for a trade
Parameters
referrer
address
address of referrer
trader
address
address of trader
volumeUsd
uint256
trade volume in usd (1e18 precision)
amountGns
uint256
amount of GNS reward (1e18 precision)
amountValueUsd
uint256
USD value of GNS reward (1e18 precision)
AllyRewardsClaimed
Emitted when an ally claims his pending rewards
Parameters
ally
address
address of ally
amountGns
uint256
GNS pending rewards amount
ReferrerRewardsClaimed
Emitted when a referrer claims his pending rewards
Parameters
referrer
address
address of referrer
amountGns
uint256
GNS pending rewards amount