From 7dd594fe09f9b3e963a1bf8d7874f01428a0e905 Mon Sep 17 00:00:00 2001 From: franz Date: Tue, 19 Nov 2024 07:33:56 +0100 Subject: [PATCH] apr change --- .changeset/khaki-panthers-confess.md | 5 +++++ .../pool/lib/apr-data-sources/ve-bal-gauge-apr.service.ts | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 .changeset/khaki-panthers-confess.md diff --git a/.changeset/khaki-panthers-confess.md b/.changeset/khaki-panthers-confess.md new file mode 100644 index 00000000..8f717c78 --- /dev/null +++ b/.changeset/khaki-panthers-confess.md @@ -0,0 +1,5 @@ +--- +'backend': patch +--- + +adapt gauge apr again as per zen dragon diff --git a/modules/pool/lib/apr-data-sources/ve-bal-gauge-apr.service.ts b/modules/pool/lib/apr-data-sources/ve-bal-gauge-apr.service.ts index b4c46e0d..51915e6d 100644 --- a/modules/pool/lib/apr-data-sources/ve-bal-gauge-apr.service.ts +++ b/modules/pool/lib/apr-data-sources/ve-bal-gauge-apr.service.ts @@ -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) => { @@ -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; }