|
1 | 1 | import StakingCapBar from "@/components/StakingCapBar";
|
2 | 2 |
|
3 |
| -# Examples(WIP) |
| 3 | +# Examples |
4 | 4 |
|
5 |
| -<StakingCapBar fillPercentage={50} secondFillPercentage={20} /> |
| 5 | +This reference page provides examples of various scenarios to illustrate the Mathematical Representations of OIS. |
6 | 6 |
|
7 |
| -### Example 1:Only Publisher State |
| 7 | +NOTE: All the symbols used in the examples are explained in the [Mathematical Representation](/home/pyth-token/oracle-integrity-staking/mathematical-representation) section. |
8 | 8 |
|
9 |
| -$$ |
10 |
| -\text{Publisher's Stake} \quad{S^p_p} = 100 |
11 |
| -$$ |
| 9 | +## Example 1: Only Publisher Stake |
12 | 10 |
|
13 |
| -$$ |
14 |
| -\text{Delegator Stake} \quad{S^d_p} = 0 |
15 |
| -$$ |
| 11 | +This example take the case where only the publisher has staked PYTH tokens. |
16 | 12 |
|
17 | 13 | $$
|
18 |
| -\text{Total Stake} \quad{S_p} = {S^p_p} + {S^d_p} = 100 |
19 |
| -$$ |
| 14 | +\begin{aligned} |
| 15 | +{S^p_p} &= 100 \\ |
| 16 | +{S^d_p} &= 0 \\ |
| 17 | +{S^p} &= {S^p_p} + {S^d_p} = 100 + 0 = 100 \\ |
| 18 | +{C}_p &= 500 \\ |
| 19 | +\text{Total Amount eligible for Reward} \quad{R_p} &= min({S}_p, {C}_p) = min(500, 100) = 100 \\ |
| 20 | +\text{Reward Rate} \quad{r} &= 10\% \\ |
20 | 21 |
|
21 |
| -$$ |
22 |
| -\text{Pool Cap} \quad{C}_p = 500 |
| 22 | +\text{Total Reward} \quad{R_p} &= {r} \times {E_p} = 10\% \times 100 = 10 \\ |
| 23 | +\text{Publisher Reward} \quad{R^p_p} &= {r} \times min({S^p_p}, {C}_p) = 10\% \times 100 = 10 \\ |
| 24 | +\text{Delegator Reward} \quad{R^d_p} &= {R_p} - {R^p_p} = 10 - 10 = 0 \\ |
| 25 | +\end{aligned} |
23 | 26 | $$
|
24 | 27 |
|
25 |
| -$$ |
26 |
| -\text{Total Amount eligible for Reward} \quad{R_a} = min({S}_p, {C}_p) = min(500, 100) = 100 |
27 |
| -$$ |
| 28 | + |
| 29 | +# Example 2: Publisher and Delegator Stake |
| 30 | + |
| 31 | +This example take the case where both the publisher and the delegator have staked PYTH tokens. |
28 | 32 |
|
29 | 33 | $$
|
30 |
| -\text{Reward Rate} \quad{r} = 10\% |
| 34 | +\begin{aligned} |
| 35 | +{S^p_p} &= 100 \\ |
| 36 | +{S^d_p} &= 100 \\ |
| 37 | +{S^p} &= {S^p_p} + {S^d_p} = 100 + 100 = 200 \\ |
| 38 | +{C}_p &= 500 \\ |
| 39 | +\text{Total Amount eligible for Reward} \quad{R_p} &= min({S}_p, {C}_p) = min(500, 200) = 200 \\ |
| 40 | +\text{Reward Rate} \quad{r} &= 10\% \\ |
| 41 | +\text{Total Reward} \quad{R_p} &= {r} \times {E_p} = 10\% \times 200 = 20 \\ |
| 42 | +\text{Publisher Reward} \quad{R^p_p} &= {r} \times min({S^p_p}, {C}_p) = 10\% \times 100 = 10 \\ |
| 43 | +\text{Delegator Reward} \quad{R^d_p} &= {R_p} - {R^p_p} = 20 - 10 = 10 \\ |
| 44 | +\end{aligned} |
31 | 45 | $$
|
32 | 46 |
|
| 47 | +# Example 3: Publisher and Delegator Stake more than the Cap |
| 48 | + |
| 49 | +This example take the case where the combined stake of both the publisher and the delegator is more than the cap. |
| 50 | + |
33 | 51 | $$
|
34 |
| -\text{Total Reward} \quad{R_p} = {r} \times {E_p} = 10\% \times 100 = 10 |
| 52 | +\begin{aligned} |
| 53 | +{S^p_p} &= 300 \\ |
| 54 | +{S^d_p} &= 300 \\ |
| 55 | +{S^p} &= {S^p_p} + {S^d_p} = 300 + 300 = 600 \\ |
| 56 | +{C}_p &= 500 \\ |
| 57 | +\text{Total Amount eligible for Reward} \quad{R_p} &= min({S}_p, {C}_p) = min(500, 600) = 500 \\ |
| 58 | +\text{Reward Rate} \quad{r} &= 10\% \\ |
| 59 | +\text{Total Reward} \quad{R_p} &= {r} \times {E_p} = 10\% \times 500 = 50 \\ |
| 60 | +\text{Publisher Reward} \quad{R^p_p} &= {r} \times min({S^p_p}, {C}_p) = 10\% \times 300 = 30 \\ |
| 61 | +\text{Delegator Reward} \quad{R^d_p} &= {R_p} - {R^p_p} = 50 - 30 = 20 \\ |
| 62 | +\end{aligned} |
35 | 63 | $$
|
36 | 64 |
|
| 65 | + |
| 66 | +# Example 4: Introducing Delegator Fees |
| 67 | + |
| 68 | +This example demonstrates how delegator fees affect the reward distribution between publishers and delegators. |
| 69 | + |
37 | 70 | $$
|
38 |
| -\text{Publisher Reward} \quad{R^p_p} = {r} \times min({S^p_p}, {C}_p) = 10\% \times 100 = 10 |
| 71 | +\begin{aligned} |
| 72 | +\quad{S^p_p} &= 200 \\ |
| 73 | +\quad{S^d_p} &= 300 \\ |
| 74 | +\quad{S^p} &= {S^p_p} + {S^d_p} = 200 + 300 = 500 \\ |
| 75 | +\quad{C}_p &= 500 \\ |
| 76 | +\quad{R_p} &= min({S}_p, {C}_p) = min(500, 500) = 500 \\ |
| 77 | +\quad{r} &= 10\% \\ |
| 78 | +\quad{f} &= 2\% \\ |
| 79 | +
|
| 80 | +\quad{R_p} &= {r} \times {R_p} = 10\% \times 500 = 50 \\ |
| 81 | +\quad{R^p_p} &= {r} \times min({S^p_p}, {C}_p) = 10\% \times 200 = 20 \\ |
| 82 | +\quad{R^d_p} &= {R_p} - {R^p_p} = 50 - 20 = 30 \\ |
| 83 | +\text{Fee paid by Delegator} \quad{F^d_p} &= {f} \times {R^d_p} = 2\% \times 30 = 0.6 \\ |
| 84 | +\text{Final Delegator Reward} \quad{R^d_p} &= {R^d_p} - {F^d_p} = 30 - 0.6 = 29.4 \\ |
| 85 | +\text{Total Publisher Reward} \quad{R^p_p} &= {R^p_p} + {F^d_p} = 20 + 0.6 = 20.6 \\ |
| 86 | +\end{aligned} |
39 | 87 | $$
|
40 | 88 |
|
| 89 | +In this example, the delegator pays a 2% fee on their rewards to the publisher. This fee is deducted from the delegator's reward and added to the publisher's reward. |
| 90 | + |
| 91 | + |
| 92 | +# Example 5: Slashing event on the pool |
| 93 | + |
| 94 | +This example demonstrates the impact of a slashing event on the staked PYTH tokens. |
| 95 | + |
41 | 96 | $$
|
42 |
| -\text{Delegator Reward} \quad{R^d_p} = {R_p} - {R^p_p} = 10 - 10 = 0 |
| 97 | +\begin{aligned} |
| 98 | +\quad{S^p_p} &= 200 \\ |
| 99 | +\quad{S^d_p} &= 300 \\ |
| 100 | +\quad{S^p} &= {S^p_p} + {S^d_p} = 200 + 300 = 500 \\ |
| 101 | +\quad{C}_p &= 500 \\ |
| 102 | +\quad{R_p} &= min({S}_p, {C}_p) = min(500, 500) = 500 \\ |
| 103 | +\quad{r} &= 10\% \\ |
| 104 | +\quad{f} &= 2\% \\ |
| 105 | +
|
| 106 | +\quad{R_p} &= {r} \times {R_p} = 10\% \times 500 = 50 \\ |
| 107 | +\quad{R^p_p} &= {r} \times min({S^p_p}, {C}_p) = 10\% \times 200 = 20 \\ |
| 108 | +\quad{R^d_p} &= {R_p} - {R^p_p} = 50 - 20 = 30 \\ |
| 109 | +\text{Fee paid by Delegator} \quad{F^d_p} &= {f} \times {R^d_p} = 2\% \times 30 = 0.6 \\ |
| 110 | +
|
| 111 | +\text{Slashed percentage}\quad{z} &= 50\% \\ |
| 112 | +\text{Final Delegator Reward} \quad{\Pi^d_p} &= ( R^p_p + f \cdot R^d_p ) - z \cdot S^p_p = (20 + 0.6) - 0.5 \cdot 200 = 20.6 - 100 = -79.4 \\ |
| 113 | +\text{Total Publisher Reward} \quad{\Pi^p_p} &= {R^p_p} + {F^d_p} = 20 + 0.6 = 20.6 \\ |
| 114 | +\end{aligned} |
43 | 115 | $$
|
| 116 | + |
| 117 | +In this example, the publisher's stake is slashed by 50%. This means that the publisher's stake is reduced to 100 and the delegator's stake remains the same. |
| 118 | + |
| 119 | + |
| 120 | + |
| 121 | +{/* <StakingCapBar fillPercentage={50} secondFillPercentage={20} labelText="100" /> */} |
| 122 | + |
0 commit comments