IReferralsUtils
Interface for GNSReferrals facet (inherits types and also contains functions, events, and custom errors)
initializeReferrals
Parameters
Name | Type | Description |
---|---|---|
_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
Name | Type | Description |
---|---|---|
_value | uint256 | new ally fee % |
updateStartReferrerFeeP
Updates startReferrerFeeP
Parameters
Name | Type | Description |
---|---|---|
_value | uint256 | new start referrer fee % |
updateReferralsTargetVolumeUsd
Updates targetVolumeUsd
Parameters
Name | Type | Description |
---|---|---|
_value | uint256 | new target volume in usd |
whitelistAllies
Whitelists ally addresses
Parameters
Name | Type | Description |
---|---|---|
_allies | address[] | array of ally addresses |
unwhitelistAllies
Unwhitelists ally addresses
Parameters
Name | Type | Description |
---|---|---|
_allies | address[] | array of ally addresses |
whitelistReferrers
Whitelists referrer addresses
Parameters
Name | Type | Description |
---|---|---|
_referrers | address[] | array of referrer addresses |
_allies | address[] | array of corresponding ally addresses |
unwhitelistReferrers
Unwhitelists referrer addresses
Parameters
Name | Type | Description |
---|---|---|
_referrers | address[] | array of referrer addresses |
registerPotentialReferrer
Registers potential referrer for trader (only works if trader wasn't referred yet by someone else)
Parameters
Name | Type | Description |
---|---|---|
_trader | address | trader address |
_referral | address | referrer address |
distributeReferralReward
Distributes ally and referrer rewards
Parameters
Name | Type | Description |
---|---|---|
_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
Name | Type | Description |
---|---|---|
_referrer | address | referrer address |
getTraderLastReferrer
Returns last referrer of trader (whether referrer active or not)
Parameters
Name | Type | Description |
---|---|---|
_trader | address | address of trader |
getTraderActiveReferrer
Returns active referrer of trader
Parameters
Name | Type | Description |
---|---|---|
_trader | address | address of trader |
getReferrersReferred
Returns referrers referred by ally
Parameters
Name | Type | Description |
---|---|---|
_ally | address | address of ally |
getTradersReferred
Returns traders referred by referrer
Parameters
Name | Type | Description |
---|---|---|
_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
Name | Type | Description |
---|---|---|
_ally | address | address of ally |
getReferrerDetails
Returns referrer details
Parameters
Name | Type | Description |
---|---|---|
_referrer | address | address of referrer |
UpdatedAllyFeeP
Emitted when allyFeeP is updated
Parameters
Name | Type | Description |
---|---|---|
value | uint256 | new ally fee % |
UpdatedStartReferrerFeeP
Emitted when startReferrerFeeP is updated
Parameters
Name | Type | Description |
---|---|---|
value | uint256 | new start referrer fee % |
UpdatedOpenFeeP
Emitted when openFeeP is updated
Parameters
Name | Type | Description |
---|---|---|
value | uint256 | new open fee % |
UpdatedTargetVolumeUsd
Emitted when targetVolumeUsd is updated
Parameters
Name | Type | Description |
---|---|---|
value | uint256 | new target volume in usd |
AllyWhitelisted
Emitted when an ally is whitelisted
Parameters
Name | Type | Description |
---|---|---|
ally | address | ally address |
AllyUnwhitelisted
Emitted when an ally is unwhitelisted
Parameters
Name | Type | Description |
---|---|---|
ally | address | ally address |
ReferrerWhitelisted
Emitted when a referrer is whitelisted
Parameters
Name | Type | Description |
---|---|---|
referrer | address | referrer address |
ally | address | ally address |
ReferrerUnwhitelisted
Emitted when a referrer is unwhitelisted
Parameters
Name | Type | Description |
---|---|---|
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
Name | Type | Description |
---|---|---|
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
Name | Type | Description |
---|---|---|
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
Name | Type | Description |
---|---|---|
ally | address | address of ally |
amountGns | uint256 | GNS pending rewards amount |
ReferrerRewardsClaimed
Emitted when a referrer claims his pending rewards
Parameters
Name | Type | Description |
---|---|---|
referrer | address | address of referrer |
amountGns | uint256 | GNS pending rewards amount |