Baking Bad Insurance

Terms and conditions

Introduction

Baking Bad Insurance is a service for bakers reducing the risk of lost profits for their customers. A baker replenishes a special security deposit, which is used to cover missing payments in case of an insured event. The funds on the deposit are delegated back to the baker, therefore his staking balance remains unchanged, and his lost profit is negligible.

Insurance coverage

The amount of funds on the security deposit determines the percentage of insurance coverage, i.e. how much of the unpaid rewards will be compensated upon the occurrence of the insured event. The value of insurance coverage is constantly changing, and since the insurance rating of the baker is tied to it, we recommend replenishing the security deposit with a small margin. In our turn, we notify the bakers about approaching the boundary values ​​when they need to take action.

Data used for calculation

Constants
blockSecurityDeposit = 512
blockRewards = 16
endorsementSecurityDeposit = 64
endorsementReward = 2
endorsersPerBlock = 32
preservedCycles = 5
blocksPerCycle = 4096
tokensPerRoll = 8000
On-chain values

cycle — current cycle;
bond — baker’s own funds, consider they are used entirely as a security deposit (edge case);
stakingBalance — baker’s staking balance, including bond and delegated amount;
totalRolls — total rolls for the cycle + preservedCycles cycle.

Off-chain values

fee — baker’s service fee;
payoutDelay — number of cycles from the moment baker receives a reward till he makes a payout to a delegator (default is preservedCycles + 1);
selfDelegatedAmount — total amount of affiliated delegations;
threshold — chosen coverage level;
minInsuranceAmount — minimum insurance deposit required.

Insured reward payments

In case of an insured event, we will compensate for the unpaid rewards for the period calculated as:

insuredPeriod = payoutDelay + preservedCycles + 1

This is the minimum time required to detect the deviation in payments, and to be able to switch delegates without loss of income.

Insurance coverage calculation

Cycle constants

The total amount of generated rewards per cycle:

totalRewardPerCycle = (blockRewards + endorsementReward * endorsersPerBlock) * blocksPerCycle

The total amount of baking security deposit locked per cycle:

totalLockedPerCycle = (blockSecurityDeposit + endorsementSecurityDeposit * endorsersPerBlock) * blocksPerCycle
Baker’s capacity

Baker’s capacity is the maximum delegated amount that his bond can secure. It cannot be determined with 100% accuracy because the number of baked blocks/submitted endorsements can vary from cycle to cycle. We will use an approximation that works in most cases.

rolls = floor(stakingBalance / tokensPerRoll)

First, we get the current number of whole rolls, then we can calculate the probability of being chosen as a baker or an endorser:

winRate = rolls / totalRolls

Knowing the total amount locked for a cycle, one can calculate maximum baker capacity:

requiredBond = winRate * (totalLockedPerCycle * 6)

capacity = bond / requiredBond

effectiveStaking = min(stakingBalance * capacity, stakingBalance)
Estimated reward

Now we can determine adjusted win rate and estimated reward for n cycles:

estimatedReward(n) = winRate * totalRewardPerCycle * n
Deposit amount for a given level

First we need to determine delegators reward share, then we can calculate the deposit amount according to the chosen coverage level:

revenueShare = ((effectiveStaking - bond - selfDelegatedAmount) / effectiveStaking ) * (1 - fee)

depositAmount = revenueShare * estimatedReward(preservedCycles + 1 + payoutDelay) * threshold
Minimum deposit amount

If a delegate has little clients or none at all, the predefined minimum deposit amount minInsuranceAmount = 1000.

Threshold values

In order to incentivize insured bakers we mark them in our bakers rating with a star. Additionally, we pin to the top of the rating bakers with coverage greater than 65%. Here is a complete list of boundary values:

Coverage 35% 65% 95%
Marked in rating Empty star Half-empty star Filled star
Pinned to the top no yes yes

Insurance coverage fluctuations

Since insurance coverage depends on many factors, it's constantly changing. The following events have the most impact:

  • A change in baker's stacking balance due to the inflow/outflow of customers;
  • Baker's commission change.

When approaching a threshold, the baker receives a notification through any private communication channel:

When a baker's coverage passes through the boundary value his delegators also receive a notification through our public channels:

Insurance cases

If after payoutDelay the actual payment to the delegator is less than expected by 10% or more, then such a case is considered an insured event. Each client of the insured baker is treated separately.

Rewards calculation

Expected rewards

As a calculation base, we use only rewards for blocks and endorsements in accordance with the distributed baking rights. We do not include missed/stolen blocks, double-baking accusations, revelation rewards, etc. An expected reward for a particular delegator is calculated as follows:

expectedReward = delegatorShare * (blockRewards + endorsementRewards)
Actual rewards

An actual payout is an inbound transaction that matches the expected reward. In case of an erroneous matching, as well as in the case of using complex payment schemes (e.g. with a minimum payout threshold), such cases are considered individually (see Insurance settlement). For calculations, the current known baker’s commission is used (see Condition change).

Reimbursement amount

The delegate is recognized as a victim and is subject to compensation if he is an active client of the baker under the current conditions (see Condition change).

reimbursementAmount = min(delegatorShare * depositAmount, 90% * (expectedReward - actualReward))

Insurance settlement period

In case of insurance event detection, the baker and his delegators are notified immediately via both public and private channels.
Insured events are reviewed and settled within 6 cycles from the time of discovery. Exceptional cases, such as payout mismatching, are handled no longer than 2 cycles.

Fees

Each cycle we keep 0.1% of the amount on the security deposit, the frozen funds remain on the deposit account until a sufficient amount accumulates for withdrawal. If the baker's coverage is more than 100%, the fee is keeping of the amount at the rate of 100% coverage.

Conditions change

In the event of a change to this agreement, they take effect insuredPeriod after the announcement on Twitter channel @TezosBakingBad and telegram bot @baking_bad_bot.
To calculate the current coverage and settle insurance claims, the current baker conditions (commission, own addresses, etc.) are used. Changes in conditions are accepted insuredPeriod after the actual change or after notification.

Handling situations

Acquiring an insurance policy

  1. Fill the following form
  2. Choose the coverage using the calculator
  3. Contact us via the email, twitter or telegram
  4. Send the required amount to the issued KT address

Canceling insurance policy

  1. Apply for a withdrawal through an established private communication channel;
  2. Wait for insuredPeriod (baker remains our client during this period and the deposit is subject to fees).

This holding period is to inform all delegators and give them time to make a decision about further service usage (if needed).

Changing bakery service terms

  1. Inform us via an established private communication channel;
  2. New terms will be applied after insuredPeriod since the announcement.