Skip to content

Commit

Permalink
temp fix due uniswap v2 subgraph issues (#1048)
Browse files Browse the repository at this point in the history
  • Loading branch information
saeta.eth authored Jun 16, 2023
1 parent 3ac1ed6 commit 37b5cc4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/utils/stake/getUniswapStakingRewards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,11 @@ export const getUniswapStakingRewards = async ({
const aelinRate = rates.aelin.usd
const ethRate = rates.ethereum.usd

/*
const uniswapData: UniswapResponse = await getUniswapPoolAmount()
const aelinInPool = uniswapData.pair.reserve0
const ethInPool = uniswapData.pair.reserve1
const uniV2TotalSupplyInWei = new Wei(BigNumber.from(uniV2TotalSupply), BASE_DECIMALS)
const totalStakedBalanceInWei = new Wei(BigNumber.from(totalStakedBalance), BASE_DECIMALS)
Expand All @@ -85,16 +87,18 @@ export const getUniswapStakingRewards = async ({
const uniV2ValueInContract = totalStakedBalanceInWei.toNumber() * uniV2Price
const rewardsValuePerYear = rewardForDurationInWei.toNumber() * yearProRata * aelinRate
*/

return {
decimals: decimals || BASE_DECIMALS,
symbol: symbol || '',
userRewards: userRewards || ZERO_BN,
userStake: userStake || ZERO_BN,
tokenBalance: tokenBalance || ZERO_BN,
ethInPool,
aelinInPool,
APY: (100 * rewardsValuePerYear) / uniV2ValueInContract,
// Temp fix til uniswap v2 subgraph work
ethInPool: '0',
aelinInPool: '0',
APY: 0, // (100 * rewardsValuePerYear) / uniV2ValueInContract,
}
} catch (error) {
console.error('error: ', error)
Expand Down

0 comments on commit 37b5cc4

Please sign in to comment.