Skip to content

Commit

Permalink
Fixes pools apy loading (#1773)
Browse files Browse the repository at this point in the history
  • Loading branch information
abtestingalpha authored Jan 8, 2024
1 parent 9dac824 commit ee32256
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/synapse-interface/utils/actions/getPoolApyData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ export const getPoolApyData = async (
],
})

// console.log(`data`, data)

const synapsePerSecondResult: bigint = data[0].result
const totalAllocPointsResult: bigint = data[1].result
const poolInfoResult: PoolInfoResult = data[2].result
const lpTokenBalanceResult: bigint = data[3].result ?? 0n
const lpTokenSupplyResult: bigint = data[4].result ?? 0n

const synPriceData = prices?.synPrices ?? (await getSynPrices())
const synPriceData = prices?.synPrices?.synPrice
? prices.synPrices
: await getSynPrices()
const metisPrice = prices?.metisPrice ?? (await getMetisPrice())

const synapsePerSecond: bigint = synapsePerSecondResult ?? 0n
Expand Down
13 changes: 10 additions & 3 deletions packages/synapse-interface/utils/actions/getStakedBalance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,16 @@ export const getStakedBalance = async (
const userInfo: UserInfoResult = data[0]
const pendingSynapse: PendingSynapseResult = data[1]

return {
amount: userInfo?.result[0] ?? 0n,
reward: pendingSynapse?.result ?? 0n,
if (userInfo.status === 'success') {
return {
amount: userInfo?.result[0] ?? 0n,
reward: pendingSynapse?.result ?? 0n,
}
} else {
return {
amount: 0n,
reward: 0n,
}
}
} catch (error) {
console.error('Error from getStakedBalance: ', error)
Expand Down
1 change: 1 addition & 0 deletions packages/synapse-interface/utils/isBlacklisted.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Address, getAddress } from 'viem'
import { EXCLUDED_ADDRESSES } from '@/constants/blacklist'

export const isBlacklisted = (address: Address | string) => {
if (!address) return
try {
const checksummedAddress = getAddress(address)

Expand Down

0 comments on commit ee32256

Please sign in to comment.