@@ -18,7 +18,7 @@ library Rebates {
18
18
// Only one rebate pool exists per epoch
19
19
struct Pool {
20
20
uint256 fees; // total query fees in the rebate pool
21
- uint256 allocatedStake ; // total effective allocation of stake
21
+ uint256 effectiveAllocatedStake ; // total effective allocation of stake
22
22
uint256 claimedRewards; // total claimed rewards from the rebate pool
23
23
uint32 unclaimedAllocationsCount; // amount of unclaimed allocations
24
24
uint32 alphaNumerator; // numerator of `alpha` in the cobb-douglas function
@@ -43,7 +43,7 @@ library Rebates {
43
43
* @dev Return true if the rebate pool was already initialized.
44
44
*/
45
45
function exists (Rebates.Pool storage pool ) internal view returns (bool ) {
46
- return pool.allocatedStake > 0 ;
46
+ return pool.effectiveAllocatedStake > 0 ;
47
47
}
48
48
49
49
/**
@@ -56,37 +56,39 @@ library Rebates {
56
56
/**
57
57
* @dev Deposit tokens into the rebate pool.
58
58
* @param _indexerFees Amount of fees collected in tokens
59
- * @param _indexerAllocatedStake Effective stake allocated by indexer for a period of epochs
59
+ * @param _indexerEffectiveAllocatedStake Effective stake allocated by indexer for a period of epochs
60
60
*/
61
61
function addToPool (
62
62
Rebates.Pool storage pool ,
63
63
uint256 _indexerFees ,
64
- uint256 _indexerAllocatedStake
64
+ uint256 _indexerEffectiveAllocatedStake
65
65
) internal {
66
66
pool.fees = pool.fees.add (_indexerFees);
67
- pool.allocatedStake = pool.allocatedStake.add (_indexerAllocatedStake);
67
+ pool.effectiveAllocatedStake = pool.effectiveAllocatedStake.add (
68
+ _indexerEffectiveAllocatedStake
69
+ );
68
70
pool.unclaimedAllocationsCount += 1 ;
69
71
}
70
72
71
73
/**
72
74
* @dev Redeem tokens from the rebate pool.
73
75
* @param _indexerFees Amount of fees collected in tokens
74
- * @param _indexerAllocatedStake Effective stake allocated by indexer for a period of epochs
76
+ * @param _indexerEffectiveAllocatedStake Effective stake allocated by indexer for a period of epochs
75
77
* @return Amount of reward tokens according to Cobb-Douglas rebate formula
76
78
*/
77
79
function redeem (
78
80
Rebates.Pool storage pool ,
79
81
uint256 _indexerFees ,
80
- uint256 _indexerAllocatedStake
82
+ uint256 _indexerEffectiveAllocatedStake
81
83
) internal returns (uint256 ) {
82
84
// Calculate the rebate rewards for the indexer
83
85
uint256 totalRewards = pool.fees;
84
86
uint256 rebateReward = LibCobbDouglas.cobbDouglas (
85
87
totalRewards,
86
88
_indexerFees,
87
89
pool.fees,
88
- _indexerAllocatedStake ,
89
- pool.allocatedStake ,
90
+ _indexerEffectiveAllocatedStake ,
91
+ pool.effectiveAllocatedStake ,
90
92
pool.alphaNumerator,
91
93
pool.alphaDenominator
92
94
);
0 commit comments