Skip to content

Commit 4ccbeae

Browse files
committed
(first example)
1 parent a45ab0a commit 4ccbeae

File tree

4 files changed

+95
-5
lines changed

4 files changed

+95
-5
lines changed

components/StakingCapBar.tsx

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import React, { useState } from 'react';
2+
3+
const StakingCapBar = () => {
4+
const [maxRewardRate, setMaxRewardRate] = useState(10);
5+
6+
const barWidth = 300;
7+
const barHeight = 30;
8+
9+
return (
10+
<div className="flex flex-col items-start p-4 max-w-md">
11+
<h2 className="text-xl font-bold mb-2">Example:</h2>
12+
<div className="mb-4 w-full">
13+
<label htmlFor="rewardRateSlider" className="block text-sm font-medium text-gray-700 mb-1">
14+
Max Reward Rate: {maxRewardRate}%
15+
</label>
16+
<input
17+
type="range"
18+
id="rewardRateSlider"
19+
min="0"
20+
max="100"
21+
value={maxRewardRate}
22+
onChange={(e) => setMaxRewardRate(Number(e.target.value))}
23+
className="w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer"
24+
/>
25+
</div>
26+
<div className="relative w-full h-8 bg-gray-200 rounded">
27+
<div
28+
className="absolute top-0 left-0 h-full bg-blue-500 rounded"
29+
style={{ width: `${maxRewardRate}%` }}
30+
></div>
31+
<div className="absolute top-0 left-0 w-full h-full flex items-center justify-between px-2">
32+
<span className="text-sm font-semibold">0%</span>
33+
<span className="text-sm font-semibold">100%</span>
34+
</div>
35+
</div>
36+
<p className="mt-2 text-sm text-gray-600">Max Reward Rate = {maxRewardRate}%</p>
37+
</div>
38+
);
39+
};
40+
41+
export default StakingCapBar;

pages/home/pyth-token.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@ Governance uses a 1:1 coin-voting system, where each staked token confers one vo
2020
Any PYTH Token holder can submit proposals to the Pyth DAO as long as they have **0.25% **of the total PYTH tokens staked.
2121
At the end of the **7 day** voting period, a proposal is passes if it meets the following conditions:
2222

23-
- More yesses have been cast than nos.
23+
- **More yesses** have been cast than nos.
2424
- The "**Approval Quorum**" has been met. \
2525
**Approval Quorum** is a percentage of staked PYTH tokens that must have voted yes for the proposal to pass. "Community Vote Threshold Percentage" is expressed as percentage of staked tokens at the start of the voting period for the proposal. This percentage threshold can vary depending on the type of proposal. The current threshold can be found in the "Governances" sections of the [parameters of the DAO](https://app.realms.today/dao/PYTH/params).
2626

2727
Please note that the scope of community governance proposals may be expanded if the PYTH token holders (or the Pyth DAO) decide so.
2828

2929
### Staking PYTH for Oracle Integrity
3030

31-
The Pyth Network is built to give decentralized applications reliable and trustworthy data. The quality of the data it provides is paramount for the functioning of these applications and the overall success of the network.
31+
The Pyth Network is built to provide decentralized applications with reliable and trustworthy data. The quality of the data it provides is paramount for these application's functions and the network's overall success.
3232

33-
Pyth's [Oracle Integrity Staking] (OIS) concentrates the production of quality data in the hands of a limited set of semi-trusted entities to achieve more coverage and lower latency than the competition. The responsibility of Publishers over data quality is not just ethical but also incentivized through economics:
33+
Pyth's [Oracle Integrity Staking] (OIS) concentrates on producing quality data in the hands of a limited set of semi-trusted entities to achieve more coverage and lower latency than the competition. The responsibility of Publishers over data quality is not just ethical but also incentivized through economics:
3434

3535
- **Staking and Slashing:** Publishers can self-stake PYTH tokens as collateral. It also allows other stakers to choose publishers to delegate their PYTH tokens. In the event of data inaccuracies or inconsistencies, a portion of this stake can be slashed as a penalty. This mechanism ensures that publishers have a vested interest in providing accurate data
36-
- **Reputation:** The reputation of data publishers is directly linked to the quality of data they provide. Publishers with a track record of providing accurate data are more likely to be trusted and attract more interest
36+
- **Reputation:** The reputation of data publishers is directly linked to the quality of data they provide. Publishers with a track record of providing accurate data are more likely to be trusted and attract more interest.
3737

3838
</Steps>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import StakingCapBar from '@/components/StakingCapBar'
2+
3+
# Examples(WIP)
4+
5+
6+
### Example 1:Only Publisher State
7+
8+
$$
9+
\text{Publisher's Stake} \quad{S^p_p} = 100
10+
$$
11+
12+
$$
13+
\text{Delegator Stake} \quad{S^d_p} = 0
14+
$$
15+
16+
$$
17+
\text{Total Stake} \quad{S_p} = {S^p_p} + {S^d_p} = 100
18+
$$
19+
20+
$$
21+
\text{Pool Cap} \quad{C}_p = 500
22+
$$
23+
24+
$$
25+
\text{Total Amount eligible for Reward} \quad{R_a} = min({S}_p, {C}_p) = min(500, 100) = 100
26+
$$
27+
28+
29+
30+
31+
$$
32+
\text{Reward Rate} \quad{r} = 10\%
33+
$$
34+
35+
$$
36+
\text{Total Reward} \quad{R_p} = {r} \times {R_a} = 10\% \times 100 = 10
37+
$$
38+
39+
$$
40+
\text{Publisher Reward} \quad{R^p_p} = {r} \times min({S^p_p}, {C}_p) = 10\% \times 100 = 10
41+
$$
42+
43+
$$
44+
\text{Delegator Reward} \quad{R^d_p} = {r} \times min({S^d_p}, {C}_p) = 10\% \times 0 = 0
45+
$$

tsconfig.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@
1313
"moduleResolution": "node",
1414
"resolveJsonModule": true,
1515
"isolatedModules": true,
16-
"jsx": "preserve"
16+
"jsx": "preserve",
17+
"baseUrl": ".",
18+
"paths": {
19+
"@/components/*": ["components/*"]
20+
}
1721
},
1822
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
1923
"exclude": ["node_modules"]

0 commit comments

Comments
 (0)