Skip to content

Commit

Permalink
Fix fx fETH apy (#1032)
Browse files Browse the repository at this point in the history
Co-authored-by: Andrew <Andrew@aladdin>
  • Loading branch information
0xAndrewClark and Andrew authored Oct 16, 2023
1 parent 886faf2 commit 157aae6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/adaptors/fx-protocol/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,13 @@ const getTvlAndApy = async () => {
abi: reBalanceAbi.extraRewardState,
})
).output;
const stETHRate = (
const _stETHRate = (
await sdk.api.abi.call({
target: wstETH,
abi: CommonAbi.tokensPerStEth,
})
).output;
const stETHRate = cBN(1e18).div(_stETHRate).toFixed(4);
const { _baseNav, _fNav, _xNav } = getCurrentNav;
_tvl = cBN(rebalancesData).div(1e18).times(_fNav).div(1e18).toFixed(0);

Expand All @@ -56,7 +57,6 @@ const getTvlAndApy = async () => {
.multipliedBy(_baseNav)
.div(1e18)
.multipliedBy(stETHRate)
.div(1e18)
.div(_tvl)
.times(100);
_apy = apyWei.multipliedBy(1.04).toFixed(2);
Expand Down

0 comments on commit 157aae6

Please sign in to comment.