Skip to content

Commit 7d9b58b

Browse files
committed
updated tooltip messages
1 parent 39584dc commit 7d9b58b

File tree

7 files changed

+49
-21
lines changed

7 files changed

+49
-21
lines changed

frontend/src/components/GeyserFirst/MyStats.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { StatsContext } from 'context/StatsContext'
77
import { safeNumeral } from 'utils/numeral'
88
import TooltipTable from 'components/TooltipTable'
99
import { GeyserStatsBox } from './GeyserStatsBox'
10-
import { GET_APY_STAKE_MSG, GET_REWARD_MULTIPLIER_MSG, CURRENT_REWARDS_MSG } from '../../constants'
10+
import { GET_APY_STAKE_MSG, GET_APY_WARN_MSG, GET_REWARD_MULTIPLIER_MSG, CURRENT_REWARDS_MSG } from '../../constants'
1111

1212
export const MyStats = () => {
1313
const { ready } = useContext(Web3Context)
@@ -62,13 +62,14 @@ export const MyStats = () => {
6262
{GET_APY_STAKE_MSG()}
6363
<TooltipTable
6464
rows={[
65-
{ label: 'LP yield', value: safeNumeral(lpAPY, '0.00%') },
66-
{ label: 'Geyser drip', value: safeNumeral(geyserAPY, '0.00%') },
67-
{ label: 'Bonus', value: '0.00%' },
65+
{ label: 'LP APY', value: safeNumeral(lpAPY, '0.00%') },
66+
{ label: 'Geyser drip rate', value: safeNumeral(geyserAPY, '0.00%') },
67+
// { label: 'Bonus', value: '0.00%' },
6868
]}
6969
totalLabel="Combined APY"
7070
totalValue={safeNumeral(finalAPY, '0.00%')}
7171
/>
72+
<ApyWarning>{GET_APY_WARN_MSG()}</ApyWarning>
7273
</div>
7374
),
7475
}}
@@ -149,3 +150,7 @@ const GeyserStatsContainer = styled.div`
149150
const GeyserStatsBoxContainer = styled.div`
150151
${tw`flex mt-4 sm:mt-3`}
151152
`
153+
154+
const ApyWarning = styled.div`
155+
${tw`mt-4 text-xs italic leading-4`}
156+
`

frontend/src/components/Home.tsx

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import TokenIcons from 'components/TokenIcons'
1212
import { safeNumeral } from 'utils/numeral'
1313
import { getGeyserTotalDeposit } from 'utils/stats'
1414
import { formatUnits } from 'ethers/lib/utils'
15+
import { getPlatformConfig } from 'config/app'
1516

1617
const nowInSeconds = () => Math.round(Date.now() / 1000)
1718

@@ -37,6 +38,7 @@ export const Home = () => {
3738
const geyserAPY = (stakeAPYs.geysers && stakeAPYs.geysers[config.ref]) || 0
3839
const apy = lpAPY + geyserAPY
3940
const programName = extractProgramName(config.name)
41+
const platform = getPlatformConfig(config)
4042

4143
let rewards = 0
4244
if (rewardTokenInfo) {
@@ -60,6 +62,7 @@ export const Home = () => {
6062
ref: config.ref,
6163
poolAddress: config.poolAddress,
6264
poolType,
65+
platform,
6366
}
6467
})
6568
.sort((g1, g2) => g2.apy - g1.apy)
@@ -87,9 +90,14 @@ export const Home = () => {
8790
{geysersToShow.map((g) => (
8891
<BodyRow key={g.ref} $inactive={!g.active}>
8992
<TableCell>
90-
<a href={g.poolAddress} target="_blank" rel="noreferrer">
91-
<TokenIcons tokens={g.stakingTokens} />
92-
</a>
93+
<IconContainer>
94+
<a href={g.poolAddress} target="_blank" rel="noreferrer">
95+
<TokenIcons tokens={g.stakingTokens} />
96+
</a>
97+
<a href={g.platform?.url} target="_blank" rel="noreferrer">
98+
<PlaformName>{g.platform?.name}</PlaformName>
99+
</a>
100+
</IconContainer>
93101
</TableCell>
94102
<TableCell>
95103
<ProgramInfo>
@@ -142,11 +150,20 @@ const TableCell = styled.td`
142150
`
143151

144152
const DataCell = styled.td`
145-
${tw`text-right pr-8`}
153+
${tw`text-right pr-8 pt-2`}
146154
`
147155

148156
const ApyCell = styled.td`
149-
${tw`text-right pr-8 font-bold text-md`}
157+
${tw`text-right pr-8 font-bold text-md pt-2`}
158+
`
159+
160+
const IconContainer = styled.div`
161+
${tw`-mt-3`}
162+
`
163+
164+
const PlaformName = styled.div`
165+
${tw`cursor-pointer text-black text-xxs uppercase font-bold`}
166+
${tw`hover:underline -mt-2`}
150167
`
151168

152169
const ProgramInfo = styled.div`

frontend/src/components/VaultFirst/VaultFirstContainer.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ export const VaultFirstContainer = () => {
1515
const { ready, connectWallet, validNetwork } = useContext(Web3Context)
1616
const { vaults, loading } = useContext(VaultContext)
1717
const navigate = useNavigate()
18-
if (loading) return <PageLoader />
18+
19+
if (!ready) {
20+
return <ErrorPage message="Wallet not connected" button="connect" onClick={() => connectWallet()} />
21+
}
1922

2023
if (ready && validNetwork === false) {
2124
return <ErrorPage message="Unsupported Network" button="Go back" onClick={() => navigate('/')} />
@@ -25,8 +28,8 @@ export const VaultFirstContainer = () => {
2528
return <ErrorPage message="Vault not found" button="Go back" onClick={() => navigate('/')} />
2629
}
2730

28-
if (!ready) {
29-
return <ErrorPage message="Wallet not connected" button="connect" onClick={() => connectWallet()} />
31+
if (ready && loading) {
32+
return <PageLoader />
3033
}
3134

3235
return (

frontend/src/constants.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,10 @@ export const AMPL_LAUNCH_DATE = 1561687200
9595
export const INITIAL_SUPPLY = 50000000
9696

9797
export const GET_APY_STAKE_MSG = () =>
98-
'The aggregate staking APY is estimated by combining geyser emissions and fees from liquidity provisioning. The geyser emission rate assumes that you have reached the max multiplier. The aggregated figure does not capture the gains or losses from holding liquidity tokens.'
98+
'The aggregate staking APY is an estimate based on two components: fees from liquidity provisioning and rewards from geyser emissions. This figure does not account for potential gains or losses associated with holding liquidity tokens.'
99+
100+
export const GET_APY_WARN_MSG = () =>
101+
'1) The LP APY is estimated by annualizing the yield from swap fees generated over the past 30 days. 2) The geyser drip rate assumes that you have reached the max multiplier.'
99102

100103
export const GET_REWARD_MULTIPLIER_MSG = ({ days = '30', multiplier = '3.0' }) =>
101104
`Stake at-least ${days} days to achieve a ${multiplier}x reward multiplier.`

frontend/src/context/StatsContext.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export const StatsContextProvider: React.FC = ({ children }) => {
140140

141141
const refreshStats = async () => {
142142
const { geyser: selectedGeyser, stakingTokenInfo, rewardTokenInfo, bonusTokensInfo } = selectedGeyserInfo
143-
if (validNetwork && selectedGeyser && stakingTokenInfo.address && rewardTokenInfo.address) {
143+
if (validNetwork && selectedGeyser && stakingTokenInfo?.address && rewardTokenInfo?.address) {
144144
setGeyserStats(await getGeyserStats(selectedGeyser, stakingTokenInfo, rewardTokenInfo, bonusTokensInfo))
145145

146146
let activeLock = null

frontend/src/context/VaultContext.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ export const VaultContextProvider: React.FC = ({ children }) => {
7979
: null
8080

8181
useEffect(() => {
82-
if (address) {
83-
console.log('vault refresh')
84-
setVaults([])
85-
setSelectedVault(null)
86-
setCurrentLock(null)
82+
console.log('vault refresh')
83+
setVaults([])
84+
setSelectedVault(null)
85+
setCurrentLock(null)
86+
if (ready) {
8787
getVaults({ variables: { id: address.toLowerCase() } })
8888
}
8989
}, [ready, networkId, address, getVaults])
@@ -124,7 +124,7 @@ export const VaultContextProvider: React.FC = ({ children }) => {
124124
withdrawRewardsFromVault,
125125
withdrawUnlockedFromVault,
126126
rewardAmountClaimedOnUnstake,
127-
loading: !ready || vaultLoading || geyserLoading,
127+
loading: vaultLoading || geyserLoading,
128128
}}
129129
>
130130
{children}

frontend/tailwind.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ module.exports = {
7676
'120px': '120px',
7777
'336px': '336px',
7878
btnsm: '120px',
79-
sm: '608px',
79+
sm: '638px',
8080
md: '768px',
8181
lg: '1024px',
8282
xl: '1280px',

0 commit comments

Comments
 (0)