Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch to week apr #93

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/PairList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ function PairList({

const fees = formattedNum(pairData.oneDayFeesUSD, true)

const feeRatio24H = pairData.oneDayFeesUSD / pairData.totalValueLockedUSD
// const apy = ((1 + feeRatio24H) ** 365 - 1) * 100
// const feeRatio24H = pairData.oneDayFeesUSD / pairData.totalValueLockedUSD
const feeRatio24H = pairData.oneWeekFeesUSD / 7 / pairData.totalValueLockedUSD
const apr = feeRatio24H * 365 * 100
const cleanedApr = isNaN(apr) || !isFinite(apr) ? 0 : apr
const displayApr = formattedPercent(cleanedApr, true)
Expand Down
1 change: 1 addition & 0 deletions src/contexts/PairData.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ function parseData(data, oneDayData, twoDayData, oneWeekData) {
// set fees properties
data.oneDayFeesUSD = parseFloat(oneDayFeesUSD);
data.feesChangeUSD = feesChangeUSD;
data.oneWeekFeesUSD = parseFloat(oneWeekData?.feesUSD) || 0

// set liquidity properties
data.liquidityChangeUSD = getPercentChange(oneDayData.totalValueLockedUSD, oneDayData.totalValueLockedUSDFirst)
Expand Down