-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3a348b5
commit 80b02c1
Showing
2 changed files
with
20 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import BigNumber from 'bignumber.js'; | ||
import getApyBreakdown from '../common/getApyBreakdown'; | ||
|
||
export const getConvexCvxFxsApys = async () => { | ||
let apy = new BigNumber(0); | ||
try { | ||
const apyData = await fetch('https://frax.convexfinance.com/api/frax/staked-cvxfxs').then(res => | ||
res.json() | ||
); | ||
apyData?.rewards?.forEach(r => { | ||
const apr = (r?.apr || 0) / 100; | ||
apy = apy.plus(new BigNumber(apr)); | ||
}); | ||
} catch (e) { | ||
console.error('Convex fraxtal cvxFXS apy failed', e.message); | ||
} | ||
return getApyBreakdown([{ name: 'convex-fraxtal-cvxfxs', address: '' }], {}, [apy], 0); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters