Skip to content

Commit

Permalink
apr change
Browse files Browse the repository at this point in the history
  • Loading branch information
franzns committed Nov 19, 2024
1 parent 6551463 commit 7dd594f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/khaki-panthers-confess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'backend': patch
---

adapt gauge apr again as per zen dragon
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export class GaugeAprService implements PoolAprService {
const totalShares = parseFloat(pool.dynamicData.totalShares);
const bptPrice = pool.dynamicData.totalLiquidity / totalShares;
const gaugeTvl = totalShares > 0 ? parseFloat(gauge.totalSupply) * bptPrice : 0;
const workingSupply = parseFloat(gauge.workingSupply);

const aprItems = rewards
.map((reward) => {
Expand Down Expand Up @@ -116,7 +117,9 @@ export class GaugeAprService implements PoolAprService {
// this is deprecated
if (isVeBalemissions && (networkContext.chain === 'MAINNET' || gauge.version === 2)) {
let minApr = 0;
if (gaugeTvl > 0) {
if (workingSupply > 0) {
minApr = (((totalShares * 0.4) / workingSupply) * rewardPerYear) / gaugeTvl;
} else if (gaugeTvl > 0) {
minApr = rewardPerYear / gaugeTvl;
}

Expand Down

0 comments on commit 7dd594f

Please sign in to comment.