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

feat: update apy #799

Merged
merged 2 commits into from
Dec 10, 2024
Merged
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
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ VITE_CONSUMER_HOST_ENDPOINT=https://chs.subquery.network
VITE_FORUM_DOMAIN=https://forum.subquery.network
VITE_NETWORK=mainnet
VITE_GQL_PROXY=https://gql-proxy.subquery.network
VITE_NETWORK_DEPLOYMENT_ID=QmScHyGv2fyJUB2prBKCKx3i8kGrQ3wU7USq8yBJ9DWiG9
VITE_NETWORK_DEPLOYMENT_ID=QmVnojxfmZJzWihvmSuixZsAxPrGqVeNB4EdTtmL3UGiFY
VITE_PROXYGATEWAY=https://gateway.subquery.network
VITE_SUBQUERY_OFFICIAL_BASE_RPC=https://base.rpc.subquery.network/public
VITE_SUBQUERY_OFFICIAL_ETH_RPC=https://ethereum.rpc.subquery.network/public
Expand Down
25 changes: 18 additions & 7 deletions src/components/APYTooltip/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,30 @@ import { Typography } from '@subql/components';
import { Tooltip } from 'antd';

type Props = {
currentEra: number | undefined;
currentEra?: number;
calculationDescription: string | undefined;
isAverage?: boolean;
};

export const APYTooltipContent: React.FC<Props> = ({ currentEra, calculationDescription }): React.ReactNode => {
export const APYTooltipContent: React.FC<Props> = ({
currentEra,
calculationDescription,
isAverage = false,
}): React.ReactNode => {
return (
<div className="col-flex" style={{ gap: 24 }}>
{isAverage ? (
<Typography variant="small" style={{ color: '#fff' }}>
We calculated estimated APY based on the statistics from the previous 3 Eras.
</Typography>
) : (
<Typography variant="small" style={{ color: '#fff' }}>
We calculated estimated APY based on the statistics from the previous Era
{currentEra ? ` (Era ${currentEra - 1})` : null}
</Typography>
)}
<Typography variant="small" style={{ color: '#fff' }}>
We calculated estimated APY based on the statistics from the previous Era
{currentEra ? ` (Era ${currentEra - 1})` : null}
</Typography>
<Typography variant="small" style={{ color: '#fff' }}>
As conditions change between Eras, this estimate is not a guarantee for future Eras
As conditions change between Eras, this estimate is not a guarantee for future Eras.
</Typography>
{calculationDescription ? (
<Typography variant="small" style={{ color: '#fff' }}>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/delegator/AllIndexers/IndexerList/IndexerList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,10 @@ export const IndexerList: React.FC = () => {
>
Estimated APY
<APYTooltip
currentEra={undefined}
calculationDescription={
'This is an estimated APY rewarded to Delegators from this Node Operator based on the last Era.'
'This is an estimated APY rewarded to Delegators from this Node Operator based on the previous 3 Eras.'
}
isAverage
/>
</Typography>
),
Expand Down
4 changes: 2 additions & 2 deletions src/pages/delegator/TopIndexers/TopIndexersList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ const getColumns = (
>
Estimated APY
<APYTooltip
currentEra={undefined}
calculationDescription={
'This is an estimated APY rewarded to Delegators from this Node Operator based on the last Era.'
'This is an estimated APY rewarded to Delegators from this Node Operator based on the previous 3 Eras.'
}
isAverage
/>
</Typography>
),
Expand Down
Loading