Skip to main content

MembershipDirector

MembershipDirector

Deployment on Ethereum mainnet:

https://etherscan.io/address/0x7E9140557F988d43c76caDab2fD392f9172ced21

InvalidVaultPosition

error InvalidVaultPosition()

InvalidPositionType

error InvalidPositionType()

RewardsClaimed

event RewardsClaimed(address owner, uint256 rewards)

Emitted when owner claims fidu rewards

Parameters

NameTypeDescription
owneraddressthe owner claiming rewards
rewardsuint256amount of fidu claimed

constructor

constructor(contract Context _context) public

consumeHoldingsAdjustment

function consumeHoldingsAdjustment(address owner) external returns (uint256)

Adjust an owners membership score and position due to the change in their GFI and Capital holdings

Parameters

NameTypeDescription
owneraddressaddress who's holdings changed

Return Values

NameTypeDescription
[0]uint256id of membership position

collectRewards

function collectRewards(address owner) external returns (uint256 rewards)

Collect all membership yield enhancements for the owner.

Parameters

NameTypeDescription
owneraddressaddress to claim rewards for

Return Values

NameTypeDescription
rewardsuint256amount of yield enhancements collected

claimableRewards

function claimableRewards(address owner) external view returns (uint256)

Check how many rewards are claimable for the owner. The return value here is how much would be retrieved by calling collectRewards.

Parameters

NameTypeDescription
owneraddressaddress to calculate claimable rewards for

Return Values

NameTypeDescription
[0]uint256the amount of rewards that could be claimed by the owner

currentScore

function currentScore(address owner) external view returns (uint256 eligibleScore, uint256 totalScore)

Get the current score of owner

Parameters

NameTypeDescription
owneraddressaddress to check the score of

Return Values

NameTypeDescription
eligibleScoreuint256score that is currently eligible for rewards
totalScoreuint256score that will be elgible for rewards next epoch

calculateMembershipScore

function calculateMembershipScore(uint256 gfi, uint256 capital) public view returns (uint256)

Calculate the membership score

Parameters

NameTypeDescription
gfiuint256Amount of gfi
capitaluint256Amount of capital in USDC

Return Values

NameTypeDescription
[0]uint256membership score

totalMemberScores

function totalMemberScores() external view returns (uint256 eligibleTotal, uint256 nextEpochTotal)

Get the sum of all member scores that are currently eligible and that will be eligible next epoch

Return Values

NameTypeDescription
eligibleTotaluint256sum of all member scores that are currently eligible
nextEpochTotaluint256sum of all member scores that will be eligible next epoch

estimateMemberScore

function estimateMemberScore(address memberAddress, int256 gfi, int256 capital) external view returns (uint256 score)

Estimate the score for an existing member, given some changes in GFI and capital

Parameters

NameTypeDescription
memberAddressaddressthe member's address
gfiint256the change in gfi holdings, denominated in GFI
capitalint256the change in gfi holdings, denominated in USDC

Return Values

NameTypeDescription
scoreuint256resulting score for the member given the GFI and capital changes

finalizeEpochs

function finalizeEpochs() external

Finalize all unfinalized epochs. Causes the reserve splitter to distribute if there are unfinalized epochs so all possible rewards are distributed.

_allocateRewards

function _allocateRewards(address owner) private returns (uint256)

_calculateRewards

function _calculateRewards(uint256 startEpoch, uint256 eligibleMemberScore, uint256 nextEpochMemberScore) private view returns (uint256 rewards)

_shareOfEpochRewards

function _shareOfEpochRewards(uint256 epoch, uint256 memberScore) private view returns (uint256)