Skip to content

Commit

Permalink
Deploying to gh-pages from @ 091d406 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasochem committed Jun 28, 2024
1 parent c65dc3a commit ab74eaf
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 166 deletions.
Binary file modified .doctrees/configuration.doctree
Binary file not shown.
Binary file modified .doctrees/environment.pickle
Binary file not shown.
Binary file modified .doctrees/index.doctree
Binary file not shown.
Binary file modified .doctrees/payouttiming.doctree
Binary file not shown.
6 changes: 1 addition & 5 deletions _sources/configuration.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,12 @@ Available configuration parameters are:
There are two options for calculating the total rewards earned by a baker at the end of each cycle. If this parameter is missing, 'actual' rewards take affect.

- 'actual': Rewards are calculated based on the actual number of bakes, at any round. Transaction fees, bonuses and other block rewards are included in the rewards when earned. If a bake is missed, rewards are not earned and therefore not included. If endorsement rewards are not earned due to a failure to reveal a nonce or excessive unavailability of your baker, is it not included.
- 'ideal': Rewards are calculated assuming ideal behavior of the baker, and actual behavior of other bakers. If a bake is missed, 20 tez rewards are paid out despite not having been earned. If a round 0 payload has been produced, but another baker baked the block, the missed bonus is **not** paid out, because it is due to other bakers being offline and not endorsing. Transaction fees, bonuses and other block rewards are included in the rewards. The endorsing reward is paid out even in case it has not been earned. Select this type of rewards to insure against downtime of your baker but still account for real world conditions. This way, you will get optimal ranking in baker evaluation services despite any downtime.
- 'ideal': Deprecated.

Example::

rewards_type: actual
Note::
Providing '--adjusted_early_payouts' will trigger estimated payouts which are adjusted later on. See: :ref:`payout_timing`

**service_fee**
A decimal in range [0-100]. Also known as the baker's fee. This is evaluated as a percentage value. Example: If set to 5, then 5% of baking rewards are kept as a service fee by the baker.

Expand Down
18 changes: 6 additions & 12 deletions _sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ PRIVACY : TEZOS REWARD DISTRIBUTOR COLLECTS ANONYMOUS STATISTICS. PLEASE READ OU
What's TRD?
------------------------------------------------

TRD is an open-source software for distributing staking rewards from bakers to delegators introduced in detail in this Medium article_. This is not a python script but a full scale application which can continuously run in the background as a Linux service. However it does not have to be used as a service, but it can also be used interactively. The tool convinces with its simplicity and yet leaves no configuration wish unfulfilled. Whether minimum delegation threshold, special fees for some delegators, or actual vs ideal rewards - the TRD covers just about all possible constellations. Furthermore, the tool supports complex payments, pays in batches, and provides three back ends for calculations: Tezos RPC, tzpro_ API and TzKT_ API. TRD is developed and tested extensively by the community and the source code which can be found in the following Github_ repo.
TRD is an open-source software for distributing staking rewards from bakers to delegators introduced in detail in this Medium article_. This is not a python script but a full scale application which can continuously run in the background as a Linux service. However it does not have to be used as a service, but it can also be used interactively. The tool convinces with its simplicity and yet leaves no configuration wish unfulfilled. Whether minimum delegation threshold, or special fees for some delegators - the TRD covers just about all possible constellations. Furthermore, the tool supports complex payments, pays in batches. It uses TzKT_ API as backend. TRD is developed and tested extensively by the community and the source code which can be found in the following Github_ repo.

Tezos offers two kind of rewards: delegating rewards and staking rewards. TRD pays out delegation rewards. Staking rewards are paid by the protocol, and TRD does not concern itself with them.

Who needs TRD?
------------------------------------------------
Expand All @@ -22,25 +24,17 @@ What else do you need for TRD?

There are currently the following options to run TRD:

a. If you want to use RPC (not public RPC) for the reward calculation, you need a Tezos archive node.
b. If you want to use an provider (pRPC, TZPRO, tzkt) for the reward calculation, but want to inject your own transactions, at least a Tezos rolling node is needed.
c. If you want to use an provider (pRPC, TZPRO, tzkt) for the reward calculation and don't want to inject your own transactions, only the Tezos signer is needed.
a. If you want to inject your own transactions, at least a Tezos rolling node is needed.
b. If you don't want to inject your own transactions, only the Tezos signer is needed.

However, for all options the Tezos signer is needed.

**Provider notes:**

Blockwatch: TZPRO
------------------

The terms_ of TZPRO note that an account and API key are needed for the use of the API. Please review the [pricing](https://tzpro.io/#pricing) information. For further help contact hello@blockwatch.cc for more information.

In order to use your API key in the application add it to your configuration like tzpro_api_key: XXXXXXXXXX.

TzKT
-----------

With PR232_ the backend of the Tezos Reward Distributor can be optionally `Powered by TzKT API`__ under the following terms:
The backend of the Tezos Reward Distributor is `Powered by TzKT API`__ under the following terms:

TzKT API is free for everyone and for both commercial and non-commercial usage.

Expand Down
72 changes: 2 additions & 70 deletions _sources/payouttiming.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,78 +7,10 @@ Tezos rewards are paid out by the protocol at the end of a given cycle.

By default, TRD then distributes these rewards at the beginning of the next cycle.

Bakers may elect to pay their delegators early to appear more
competitive or trustworthy. But bakers paying early effectively give an “advance” to their delegators.
This means that they have a lower balance at any given point in time.

TRD behavior is to pay out the last released payment cycle. Last
released payment cycle will be calculated based on the formula:
``current_cycle - 1 + [if --adjusted_payout_timing is provided: (preserved_cycles + 1)]``.

A cycle on mainnet lasts 3 days.

The ``--adjusted_early_payouts`` argument lets the baker override when rewards
are released (paid out). Its default value is ``False`` if not provided as argument.

Possible choices are:

- ``not provided``: pay rewards after the cycle runs - 6 to 7 cycles after delegation. The recommended default choice.
- ``--adjusted_early_payouts``: pay rewards when baking rights are assigned, referred as “adjusted early payouts” (see below) - 1 to 2 cycles after delegation.

Adjusted early payouts
----------------------

Providing ``--adjusted_early_payouts`` as additional argument will trigger adjusted early payouts.

When selected, this option calculates and pays out the expected rewards based on baking and
endorsing rights only. It does not takes into account fee income,
denunciation income or rescued block income. It also assumes perfect
behavior of the baker and other bakers.

The resulting rewards are thus an estimation. When the cycle
actually runs, TRD runs the calculations for this cycle again, based on
the rewards type configured (ideal or actual). It then computes the
“overestimate” or overpaid value.

TRD then attempts to claim back this overestimate by adjusting the
amount paid. **This does not always work**. If the delegator has emptied
their account or changed delegate, there is no longer any payout to
offset a past overestimate. Thus, users are advised caution when using
this feature.

The estimate can also be lower than the final amount, for example if fees were earned in excess of the missed income, or if blocks have been rescued by the baker. In this case, the overestimate will show a negative amount, the delegator has been underpaid and will be compensated with a positive adjustment.

Overestimate, adjustment and adjusted amount paid can be seen in the
calculations CSV file.

**Example:**

**Cycle 100**: Frank and Cindy both delegate 1000 tez to Jane’s bakery. For
simplicity, Jane’s bakery has no fee and no other delegators. Her bakery is
configured with a ``--adjusted_early_payouts`` and ``rewards_type`` ``actual``.

**Cycle 103**: Since ``--adjusted_early_payouts`` is provided as argument, payout for cycle 108 happens during cycle 103. Frank and Cindy’s delegation is taken into account to compute
cylce 108’s rights. Jane’s bakery is expected to earn 80 tez rewards for
cycle 108 from baking and endorsing rewards. Frank and Cindy contribute 10% each to Jane’s staking
balance. They each receive 8 tez as part of the payout for cycle 108.

A ``calculations/108.csv`` file is generated which shows ``Overestimate:
pending`` as cycle 108 has not run yet.

**Cycle 104-108**: same as cycle 103: Frank and Cindy receive 10% each of the estimated reward.

**Cycle 109**: Jane’s bakery is expected to earn 60 tez from baking and endorsing rewards for cycle 114, so
each delegator should be paid 6 tez. TRD runs the calculations for
cycle 108 again and finds that Jane earned 0.5 tez fee for baking a
block, and failed to bake the other block, a loss of 20 tez.
Overall, Jane’s bakery overestimated its earnings by 19.5 tez.
It therefore subtracts 1.95 tez of cycle 108 payout to cycle 114 payout (which happens at cycle 109).
Frank and Cindy receive 4.05 tez as adjusted amount for cycle 114.

``calculations/108.csv`` file is updated with a total overestimate of 19.5
and their distribution across delegates: 1.95 tez for Frank and for
Cindy. ``calculations/114.csv`` file mentions an adjustment of 1.95 tez for
Frank and Cindy.
A cycle on mainnet lists 3 days.

Had Frank left the bakery at cycle 104, Jane’s bakery would have been
unable to recover his overpaid 1.95 tez.
Delegation takes 2 cycles to take effect. This is unlike staking, which is instantaneous.
6 changes: 1 addition & 5 deletions configuration.html
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,12 @@ <h2>Baker Configuration:<a class="headerlink" href="#baker-configuration" title=
<dt><strong>rewards_type</strong></dt><dd><p>There are two options for calculating the total rewards earned by a baker at the end of each cycle. If this parameter is missing, ‘actual’ rewards take affect.</p>
<ul class="simple">
<li><p>‘actual’: Rewards are calculated based on the actual number of bakes, at any round. Transaction fees, bonuses and other block rewards are included in the rewards when earned. If a bake is missed, rewards are not earned and therefore not included. If endorsement rewards are not earned due to a failure to reveal a nonce or excessive unavailability of your baker, is it not included.</p></li>
<li><p>‘ideal’: Rewards are calculated assuming ideal behavior of the baker, and actual behavior of other bakers. If a bake is missed, 20 tez rewards are paid out despite not having been earned. If a round 0 payload has been produced, but another baker baked the block, the missed bonus is <strong>not</strong> paid out, because it is due to other bakers being offline and not endorsing. Transaction fees, bonuses and other block rewards are included in the rewards. The endorsing reward is paid out even in case it has not been earned. Select this type of rewards to insure against downtime of your baker but still account for real world conditions. This way, you will get optimal ranking in baker evaluation services despite any downtime.</p></li>
<li><p>‘ideal’: Deprecated.</p></li>
</ul>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">rewards_type</span><span class="p">:</span> <span class="n">actual</span>
</pre></div>
</div>
<p>Note:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>Providing &#39;--adjusted_early_payouts&#39; will trigger estimated payouts which are adjusted later on. See: :ref:`payout_timing`
</pre></div>
</div>
</dd>
<dt><strong>service_fee</strong></dt><dd><p>A decimal in range [0-100]. Also known as the baker’s fee. This is evaluated as a percentage value. Example: If set to 5, then 5% of baking rewards are kept as a service fee by the baker.</p>
<p>Example:</p>
Expand Down
20 changes: 6 additions & 14 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ <h1>Tezos Reward Distributor (TRD)<a class="headerlink" href="#tezos-reward-dist
<p>PRIVACY : TEZOS REWARD DISTRIBUTOR COLLECTS ANONYMOUS STATISTICS. PLEASE READ OUR STATISTICS <a class="reference external" href="statistics.html">POLICY</a> FOR MORE INFORMATION.</p>
<div class="section" id="what-s-trd">
<h2>What’s TRD?<a class="headerlink" href="#what-s-trd" title="Permalink to this headline"></a></h2>
<p>TRD is an open-source software for distributing staking rewards from bakers to delegators introduced in detail in this Medium <a class="reference external" href="https://medium.com/&#64;huseyinabanox/tezos-reward-distributor-e6588c4d27e7">article</a>. This is not a python script but a full scale application which can continuously run in the background as a Linux service. However it does not have to be used as a service, but it can also be used interactively. The tool convinces with its simplicity and yet leaves no configuration wish unfulfilled. Whether minimum delegation threshold, special fees for some delegators, or actual vs ideal rewards - the TRD covers just about all possible constellations. Furthermore, the tool supports complex payments, pays in batches, and provides three back ends for calculations: Tezos RPC, <a class="reference external" href="https://tzpro.io/">tzpro</a> API and <a class="reference external" href="https://api.tzkt.io/">TzKT</a> API. TRD is developed and tested extensively by the community and the source code which can be found in the following <a class="reference external" href="https://github.com/tezos-reward-distributor-organization/tezos-reward-distributor">Github</a> repo.</p>
<p>TRD is an open-source software for distributing staking rewards from bakers to delegators introduced in detail in this Medium <a class="reference external" href="https://medium.com/&#64;huseyinabanox/tezos-reward-distributor-e6588c4d27e7">article</a>. This is not a python script but a full scale application which can continuously run in the background as a Linux service. However it does not have to be used as a service, but it can also be used interactively. The tool convinces with its simplicity and yet leaves no configuration wish unfulfilled. Whether minimum delegation threshold, or special fees for some delegators - the TRD covers just about all possible constellations. Furthermore, the tool supports complex payments, pays in batches. It uses <a class="reference external" href="https://api.tzkt.io/">TzKT</a> API as backend. TRD is developed and tested extensively by the community and the source code which can be found in the following <a class="reference external" href="https://github.com/tezos-reward-distributor-organization/tezos-reward-distributor">Github</a> repo.</p>
<p>Tezos offers two kind of rewards: delegating rewards and staking rewards. TRD pays out delegation rewards. Staking rewards are paid by the protocol, and TRD does not concern itself with them.</p>
</div>
<div class="section" id="who-needs-trd">
<h2>Who needs TRD?<a class="headerlink" href="#who-needs-trd" title="Permalink to this headline"></a></h2>
Expand All @@ -102,22 +103,16 @@ <h2>What else do you need for TRD?<a class="headerlink" href="#what-else-do-you-
<p>There are currently the following options to run TRD:</p>
<blockquote>
<div><ol class="loweralpha simple">
<li><p>If you want to use RPC (not public RPC) for the reward calculation, you need a Tezos archive node.</p></li>
<li><p>If you want to use an provider (pRPC, TZPRO, tzkt) for the reward calculation, but want to inject your own transactions, at least a Tezos rolling node is needed.</p></li>
<li><p>If you want to use an provider (pRPC, TZPRO, tzkt) for the reward calculation and don’t want to inject your own transactions, only the Tezos signer is needed.</p></li>
<li><p>If you want to inject your own transactions, at least a Tezos rolling node is needed.</p></li>
<li><p>If you don’t want to inject your own transactions, only the Tezos signer is needed.</p></li>
</ol>
</div></blockquote>
<p>However, for all options the Tezos signer is needed.</p>
<p><strong>Provider notes:</strong></p>
</div>
<div class="section" id="blockwatch-tzpro">
<h2>Blockwatch: TZPRO<a class="headerlink" href="#blockwatch-tzpro" title="Permalink to this headline"></a></h2>
<p>The <a class="reference external" href="https://tzpro.io/terms">terms</a> of TZPRO note that an account and API key are needed for the use of the API. Please review the [pricing](<a class="reference external" href="https://tzpro.io/#pricing">https://tzpro.io/#pricing</a>) information. For further help contact <a class="reference external" href="mailto:hello&#37;&#52;&#48;blockwatch&#46;cc">hello<span>&#64;</span>blockwatch<span>&#46;</span>cc</a> for more information.</p>
<p>In order to use your API key in the application add it to your configuration like tzpro_api_key: XXXXXXXXXX.</p>
</div>
<div class="section" id="tzkt">
<h2>TzKT<a class="headerlink" href="#tzkt" title="Permalink to this headline"></a></h2>
<p>With <a class="reference external" href="https://github.com/tezos-reward-distributor-organization/tezos-reward-distributor/pull/232">PR232</a> the backend of the Tezos Reward Distributor can be optionally <a class="reference external" href="https://tzkt.io/">Powered by TzKT API</a> under the following terms:</p>
<p>The backend of the Tezos Reward Distributor is <a class="reference external" href="https://tzkt.io/">Powered by TzKT API</a> under the following terms:</p>
<blockquote>
<div><p>TzKT API is free for everyone and for both commercial and non-commercial usage.</p>
<p>If your application or service uses the TzKT API in any forms: directly on frontend or indirectly on backend, you should mention that fact on your website or application by placing the label “Powered by TzKT API” with a direct link to tzkt.io.</p>
Expand Down Expand Up @@ -154,10 +149,7 @@ <h2>TRD Art Work<a class="headerlink" href="#trd-art-work" title="Permalink to t
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="rundocker.html">How to run TRD in Docker</a></li>
<li class="toctree-l1"><a class="reference internal" href="payouttiming.html">Payout timing</a><ul>
<li class="toctree-l2"><a class="reference internal" href="payouttiming.html#adjusted-early-payouts">Adjusted early payouts</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="payouttiming.html">Payout timing</a></li>
<li class="toctree-l1"><a class="reference internal" href="plugins.html">Plugins</a><ul>
<li class="toctree-l2"><a class="reference internal" href="plugins.html#email-plugin">Email Plugin</a></li>
<li class="toctree-l2"><a class="reference internal" href="plugins.html#telegram-plugin">Telegram Plugin</a></li>
Expand Down
Loading

0 comments on commit ab74eaf

Please sign in to comment.