Skip to content

Commit

Permalink
Add Node Provider rewards explanation (#1075)
Browse files Browse the repository at this point in the history
Co-authored-by: Saša Tomić <[email protected]>
  • Loading branch information
pietrodimarco-dfinity and sasa-tomic authored Nov 13, 2024
1 parent 2069c13 commit b918202
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 21 deletions.
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { WidgetNumber } from './Widgets';
import { boxStyleWidget } from '../Styles';
import { ExportTable } from './ExportTable';
import { GridColDef, GridRowsProp } from '@mui/x-data-grid';
import { NodeProvidersRewardExplanation } from './RewardsInfo';

export interface NodeProviderRewardsChartProps {
provider: string;
Expand Down Expand Up @@ -66,6 +67,9 @@ export const NodeProviderRewardsChart: React.FC<NodeProviderRewardsChartProps> =
<WidgetNumber value={Math.round(Number(rewards_xdr_old[0]) / 100000000).toString()} title="Last Rewards ICP Received" sxValue={{ color: '#FFCC00' }} />
</Box>
</Grid>
<Grid item xs={12} md={12}>
<NodeProvidersRewardExplanation/>
</Grid>
<Grid item xs={12} md={12}>
<Typography variant="body1" gutterBottom>
Computation Log
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const NodeRewardExplanation = () => {
How are rewards computed?
</Typography>
</Grid>
<Grid item xs={12} md={4}>
<Grid item xs={12} md={6}>
<Typography variant="body2" gutterBottom>
Node Unassigned:
</Typography>
Expand Down Expand Up @@ -62,7 +62,7 @@ const NodeRewardExplanation = () => {
</ListItem>
</List>
</Grid>
<Grid item xs={12} md={4}>
<Grid item xs={12} md={6}>

{/* Linear Reduction Function */}
<List sx={{ listStyle: 'circle', ml: 4 }}>
Expand All @@ -89,24 +89,59 @@ const NodeRewardExplanation = () => {
</List>

<Typography variant="body2" color="textSecondary" gutterBottom>
The reward multiplier for the assigned period is computed by subtracting the rewards reduction from 100%.
The reward multiplier in percentage is then computed for the rewarding period, by subtracting the rewards reduction from 100%.
</Typography>
</ListItem>
</List>
</Grid>
<Grid item xs={12} md={4}>
<List sx={{ listStyle: 'circle', ml: 4 }}>
{/* Total Rewards Calculation Placeholder */}
<ListItem sx={{ display: 'list-item' }}>
<Typography variant="body2" gutterBottom>
Compute Reward Multiplier:
</Typography>
<Typography variant="body2" color="textSecondary" gutterBottom>
The final reward multiplier is then the weighted average between the multiplier for days in which the node is assigned to a subnet and 100% for the days in which the node is unassigned.
</Typography>
</ListItem>
</List>
</Grid>
);
};

export const NodeProvidersRewardExplanation = () => {
return (
<Grid container>
{/* Title Section */}
<Grid item xs={12}>
<Typography variant="body1" gutterBottom>
How are rewards computed?
</Typography>
</Grid>
<Grid item xs={12} md={6}>
<Typography variant="body2" gutterBottom>
Nodes not registered:
</Typography>
<Typography variant="body2" color="textSecondary" gutterBottom>
Nodes which are not registered in the period get no rewards (0%).
</Typography>

<Typography variant="body2" gutterBottom>
Nodes Assigned:
</Typography>
<Typography variant="body2" color="textSecondary" gutterBottom>
Reward for a single node assigned to a subnet is calculated as follows:
</Typography>
<Typography variant="body2" gutterBottom>
<InlineMath math="Node \, Rewards = {\text{Rewards Multiplier}} * {\text{monthly permyriad XDRs (from Rewards Table)}}" />
</Typography>
<Typography variant="body2" gutterBottom>
Nodes Unassigned:
</Typography>
<Typography variant="body2" color="textSecondary" gutterBottom>
When unassigned to a subnet, the reward calculation for a single node follows these steps:
</Typography>
<Typography variant="body2" gutterBottom>
<InlineMath math="Node \, Rewards = {\text{Avg. Rewards Multiplier Assigned}} * {\text{monthly permyriad XDRs (from Rewards Table)}}" />
</Typography>
</Grid>
<Grid item xs={12} md={6}>
<Typography variant="body2" gutterBottom>
Final Node Provider rewards:
</Typography>
<Typography variant="body2" color="textSecondary" gutterBottom>
The final node provider rewards is computed as the sum of the rewards of the individual machines
</Typography>
</Grid>
</Grid>
);
};
Expand Down

0 comments on commit b918202

Please sign in to comment.