Skip to content

Commit

Permalink
Using workingSupply to calc staking APRs on L2s (#463)
Browse files Browse the repository at this point in the history
* include L2 gauges in workingSupply calc

* fix: inline doc correction
  • Loading branch information
gmbronco authored Oct 5, 2023
1 parent 5afd652 commit 696177f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export class GaugeAprService implements PoolAprService {
(networkContext.chain === 'MAINNET' || gauge.version === 2)
) {
let minApr = 0;
if (networkContext.chain === 'MAINNET' && workingSupplyTvl > 0) {
if (workingSupplyTvl > 0) {
minApr = rewardPerYear / workingSupplyTvl;
} else if (gaugeTvl > 0) {
minApr = rewardPerYear / gaugeTvl;
Expand Down
2 changes: 1 addition & 1 deletion modules/pool/lib/staking/gauge-staking.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ export class GaugeStakingService implements PoolStakingService {
}),
...Object.keys(rewardsData)
.map((gaugeAddress) => [
// L2 V1 case, includes tokens other than BAL
// L2 V1 case with any token
...Object.keys(rewardsData[gaugeAddress].rewardData).map((tokenAddress) => {
const id = `${gaugeAddress}-${tokenAddress}`.toLowerCase();
const { rate, period_finish } = rewardsData[gaugeAddress].rewardData[tokenAddress];
Expand Down

0 comments on commit 696177f

Please sign in to comment.