Examples

This reference page provides examples of various scenarios to illustrate the Mathematical Representations of OIS.

NOTE: All the symbols used in the examples are explained in the Mathematical Representation section.

Example 1: Only Publisher Stake

This example takes the case of one pool where the pool has stake from only the publisher.


Example 1 Spp=100Spd=0Sp=Spp+Spd=100+0=100Cp=500Total Amount eligible for RewardsEp=min(Sp,Cp)=min(500,100)=100Annual Rate of Rewardsr=10%Total Rewards for one yearRp=r×Ep=10%×100=10Publisher RewardsRpp=r×min(Spp,Cp)=10%×100=10Delegator RewardsRpd=RpRpp=1010=0Effective Publisher APYrpp=RppSpp=10100=10%Effective Delegator APYrpd=RpdSpd=0%\begin{aligned} {S^p_p} &= 100 \\ {S^d_p} &= 0 \\ {S_p} &= {S^p_p} + {S^d_p} = 100 + 0 = 100 \\ {C}_p &= 500 \\ \text{Total Amount eligible for Rewards} \quad{E_p} &= min({S}_p, {C}_p) = min(500, 100) = 100 \\ \text{Annual Rate of Rewards} \quad{r} &= 10\% \\ \text{Total Rewards for one year} \quad{R_p} &= {r} \times {E_p} = 10\% \times 100 = 10 \\ \text{Publisher Rewards} \quad{R^p_p} &= {r} \times min({S^p_p}, {C}_p) = 10\% \times 100 = 10 \\ \text{Delegator Rewards} \quad{R^d_p} &= {R_p} - {R^p_p} = 10 - 10 = 0 \\ \text{Effective Publisher APY} \quad{r^p_p} &= \frac{R^p_p}{S^p_p} = \frac{10}{100} = 10\% \\ \text{Effective Delegator APY} \quad{r^d_p} &= \frac{R^d_p}{S^d_p} = 0\% \\ \end{aligned}

Example 2: Publisher and Delegator Stake

This example takes the case where the pool has stake from both the publisher and the delegator.


Example 2 Spp=100Spd=100Sp=Spp+Spd=100+100=200Cp=500Total Amount eligible for RewardsEp=min(Sp,Cp)=min(500,200)=200Annual Rate of Rewardsr=10%Total Rewards for one yearRp=r×Ep=10%×200=20Publisher RewardsRpp=r×min(Spp,Cp)=10%×100=10Delegator RewardsRpd=RpRpp=2010=10Effective Publisher APYrpp=RppSpp=10100=10%Effective Delegator APYrpd=RpdSpd=10100=10%\begin{aligned} {S^p_p} &= 100 \\ {S^d_p} &= 100 \\ {S_p} &= {S^p_p} + {S^d_p} = 100 + 100 = 200 \\ {C}_p &= 500 \\ \text{Total Amount eligible for Rewards} \quad{E_p} &= min({S}_p, {C}_p) = min(500, 200) = 200 \\ \text{Annual Rate of Rewards} \quad{r} &= 10\% \\ \text{Total Rewards for one year} \quad{R_p} &= {r} \times {E_p} = 10\% \times 200 = 20 \\ \text{Publisher Rewards} \quad{R^p_p} &= {r} \times min({S^p_p}, {C}_p) = 10\% \times 100 = 10 \\ \text{Delegator Rewards} \quad{R^d_p} &= {R_p} - {R^p_p} = 20 - 10 = 10 \\ \text{Effective Publisher APY} \quad{r^p_p} &= \frac{R^p_p}{S^p_p} = \frac{10}{100} = 10\% \\ \text{Effective Delegator APY} \quad{r^d_p} &= \frac{R^d_p}{S^d_p} = \frac{10}{100} = 10\% \\ \end{aligned}

Example 3: Publisher and Delegator Stake more than the Cap

This example takes the case where the combined stake of both the publisher and the delegator exceeds the cap.


Example 3 Spp=300Spd=300Sp=Spp+Spd=300+300=600Cp=500Total Amount eligible for RewardsEp=min(Sp,Cp)=min(500,600)=500Annual Rate of Rewardsr=10%Total Rewards for one yearRp=r×Ep=10%×500=50Publisher RewardsRpp=r×min(Spp,Cp)=10%×300=30Delegator RewardsRpd=RpRpp=5030=20Effective Publisher APYrpp=RppSpp=30300=10%Effective Delegator APYrpd=RpdSpd=20300=6.67%\begin{aligned} {S^p_p} &= 300 \\ {S^d_p} &= 300 \\ {S_p} &= {S^p_p} + {S^d_p} = 300 + 300 = 600 \\ {C}_p &= 500 \\ \text{Total Amount eligible for Rewards} \quad{E_p} &= min({S}_p, {C}_p) = min(500, 600) = 500 \\ \text{Annual Rate of Rewards} \quad{r} &= 10\% \\ \text{Total Rewards for one year} \quad{R_p} &= {r} \times {E_p} = 10\% \times 500 = 50 \\ \text{Publisher Rewards} \quad{R^p_p} &= {r} \times min({S^p_p}, {C}_p) = 10\% \times 300 = 30 \\ \text{Delegator Rewards} \quad{R^d_p} &= {R_p} - {R^p_p} = 50 - 30 = 20 \\ \text{Effective Publisher APY} \quad{r^p_p} &= \frac{R^p_p}{S^p_p} = \frac{30}{300} = 10\% \\ \text{Effective Delegator APY} \quad{r^d_p} &= \frac{R^d_p}{S^d_p} = \frac{20}{300} = 6.67\% \\ \end{aligned}

Example 4: Introducing Delegator Fees

This example demonstrates how the delegation fee affect the reward distribution between the publisher and the delegator.


Example 4 Spp=200Spd=300Sp=Spp+Spd=200+300=500Cp=500Ep=min(Sp,Cp)=min(500,500)=500r=10%f=2%Rp=r×Rp=10%×500=50Rpp=r×min(Spp,Cp)=10%×200=20Rpd=RpRpp=5020=30Fee paid by DelegatorFpd=f×Rpd=2%×30=0.6Final Delegator RewardsRpd=RpdFpd=300.6=29.4Total Publisher RewardsRpp=Rpp+Fpd=20+0.6=20.6Effective Publisher APYrpp=RppSpp=20.6200=10.3%Effective Delegator APYrpd=RpdSpd=29.4300=9.8%\begin{aligned} \quad{S^p_p} &= 200 \\ \quad{S^d_p} &= 300 \\ \quad{S_p} &= {S^p_p} + {S^d_p} = 200 + 300 = 500 \\ \quad{C}_p &= 500 \\ \quad{E_p} &= min({S}_p, {C}_p) = min(500, 500) = 500 \\ \quad{r} &= 10\% \\ \quad{f} &= 2\% \\ \quad{R_p} &= {r} \times {R_p} = 10\% \times 500 = 50 \\ \quad{R^p_p} &= {r} \times min({S^p_p}, {C}_p) = 10\% \times 200 = 20 \\ \quad{R^d_p} &= {R_p} - {R^p_p} = 50 - 20 = 30 \\ \text{Fee paid by Delegator} \quad{F^d_p} &= {f} \times {R^d_p} = 2\% \times 30 = 0.6 \\ \text{Final Delegator Rewards} \quad{R^d_p} &= {R^d_p} - {F^d_p} = 30 - 0.6 = 29.4 \\ \text{Total Publisher Rewards} \quad{R^p_p} &= {R^p_p} + {F^d_p} = 20 + 0.6 = 20.6 \\ \text{Effective Publisher APY} \quad{r^p_p} &= \frac{R^p_p}{S^p_p} = \frac{20.6}{200} = 10.3\% \\ \text{Effective Delegator APY} \quad{r^d_p} &= \frac{R^d_p}{S^d_p} = \frac{29.4}{300} = 9.8\% \\ \end{aligned}

In the 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.

Example 5: Slashing event on the pool

This example demonstrates the impact of a slashing event on the staked PYTH tokens and rewards distributed to both the publisher and the delegator.

Spp=300Spd=200Sp=Spp+Spd=300+200=500Maximum slashing ratez=5%Publisher Stake post slashingSpp=(15%)×300=285Delegator Stake post slashingSpd=(15%)×200=190\begin{aligned} \quad{S^p_p} &= 300 \\ \quad{S^d_p} &= 200 \\ \quad{S_p} &= {S^p_p} + {S^d_p} = 300 + 200 = 500 \\ \text{Maximum slashing rate}\quad{z} &= 5\% \\ \text{Publisher Stake post slashing}\quad{S^p_p} &= (1 - 5\%) \times 300 = 285 \\ \text{Delegator Stake post slashing}\quad{S^d_p} &= (1 - 5\%) \times 200 = 190 \\ \end{aligned}

In this example, the stake is uniformly slashed by 5%, affecting both the publisher and the delegator. Slashing impact the total stake into the pool, regardless of the Cap.

Checkout out the detailed slashing example at Slashing Rulebook

Example 6: Increasing the cap of the pool

This example shows how a publisher can increase the cap of the pool assigned to them. As described in the Mathematical Representation, the cap is calculated as:

Cp=MsSymbols_p1max(ns,Z)\large{{\bold{C_p}} = M \cdot \sum_{s \in \text{Symbols\_p}} \frac{1}{\max(n_s, Z)}}

In this scenario, let's assume that

  • The constant parameter representing the target stake per symbol MM is 100
  • The constant parameter to control cap contribution ZZ is 5
  • Current symbols published are {s1s_{1},.., s5s_{5}} where for every symbol currently published nsn_s = 5 (for i = 1 .. 5 nsin_{s_i} = 5)

The cap of the pool is calculated as follows:

Cp=Ms{s1,.., s5}1max(ns,Z)=100s{s1,.., s5}1max(5,5)=100s{s1,.., s5}15=1001=100\begin{aligned} \quad{C_p} &= M \cdot \sum_{s \in \text{\{$s_{1}$,.., $s_{5}$\}}} \frac{1}{\max(n_s, Z)} \\ &= 100 \cdot \sum_{s \in \text{\{$s_{1}$,.., $s_{5}$\}}} \frac{1}{\max(5, 5)} \\ &= 100 \cdot \sum_{s \in \text{\{$s_{1}$,.., $s_{5}$\}}} \frac{1}{5} \\ &= 100 \cdot 1 = 100 \\ \end{aligned}

Here publisher has 2 options to increase the cap of the pool assigned to it.

Option 1: Publish new symbol with a low number of publishers

Assume the publisher decides to publish a new symbol with only 3 publishers, nslown_{s_{low}} = 3.

The new pool cap would change as the sum of the current cap from the 5 symbols published plus the cap gained from publishing slows_{low} (where nslown_{s_{low}} = 3 + 1 = 4)

Cpoption1=100+1001max(4,5)=100+10015=100+20=120\begin{aligned} C_{p_{option1}} &= 100 + 100 \cdot \frac{1}{\max(4, 5)} \\ &= 100 + 100 \cdot \frac{1}{5} \\ &= 100 + 20 = 120 \end{aligned}

Option 2: Publish additional symbols where the cap of 32 publishers is not reached

Assuming there is room to publish 5 more symbols {s6s_{6},.., s10s_{10}} where each have currently 9 publishers ( for i = 6 .. 10 nsin_{s_i} = 9)

The new pool cap would change as the sum of the current cap from the 5 symbols published plus the cap gained from publishing the additional symbols {s6s_{6},.., s10s_{10}} (where for i = 6 .. 10 nsin_{s_i} = 10)

Cpoption2=100+100s{s6,.., s10}1max(10,5)=100+1005110=100+50=150\begin{aligned} C_{p_{option2}} &= 100 + 100 \cdot \sum_{s \in \text{\{$s_{6}$,.., $s_{10}$\}}} \frac{1}{\max(10, 5)} \\ &= 100 + 100 \cdot 5 \cdot \frac{1}{10} \\ &= 100 + 50 = 150 \end{aligned}

Reward Calculator

Use the calculator below to calculate publisher and delegator rewards based on your inputs.

Reward Simulator

Calculated Rewards:

Publisher Reward (RppR^p_p): 26

Delegator Reward (RpdR^d_p): 24

Calculated Reward Rates(Yearly):

Publisher Reward Rate (rppr^p_p): 13%

Delegator Reward Rate (rpdr^d_p): 8%

Last updated on