---
# System prepended metadata

title: Termination fee governance surface and functional form
tags: [termination fee]

---

# Termination fee governance surface and functional form

###### tags: `termination fee`

The termination fee is assessed under two conditions:
1. The protocol initiates termination of a sector, after the sector has remained "down", i.e. in fault status, for a period of time (denoted $\hat x$); or
2. A storage provider manually initiates termination of a sector.

We treat the first condition in what follows, bearing in mind that its form will impact storage provider incentives on whether or not to trigger a manual termination. The second condition is then discussed in the [Notes on termination fee functional form](#Notes-on-termination-fee-functional-form) section below.

## Model summary

When the termination fee is assessed after the protocol initiates termination, it accompanies fault fees accrued during the time the sector has been down. We assume that fault "down time" is exponentially distributed, i.e. we restrict attention to the circumstances under which a storage provider has experienced an actual fault, whose time to repair, $x$, is a random variable distributed with the probability density function $f_\lambda(x)$:
$$
f_\lambda(x) : = \lambda e^{-\lambda x},
$$
where $\lambda$ is the distribution's _rate_ parameter and is denominated in units of inverse time.

During the sector's down time it accrues fault fees at a constant rate, denoted $N < 0$, and if after a time $\hat x$ the sector has not recovered the termination fee is assessed in a single "lump sum", which may be written as a multiple of the fault fee, i.e. as $TN$ for some value $T>0$ (discussed further below--recall that $N
<0$). Using this formulation, the [Simplified version or auto-adjusting rate](https://hackmd.io/@R02mDHrYQ3C4PFmNaxF5bw/H1LzmEVVF#Simplified-version-or-auto-adjusting-rate) specification indicates that the expected sector penalty $C < 0$ is:
$$
C := F(N, \hat x, T; \lambda) = N\int_0^{\hat x}x\lambda e^{-\lambda x}dx + NT \int_{\hat x}^\infty \lambda e^{-\lambda x}dx = \\
Ne^{-\lambda \hat x} \left ( \frac{1}{\lambda} \left (e^{\lambda \hat x} - 1 \right ) - \hat x + T \right ).
$$

This can also be written as
$$
G(N,\hat x, T, C ; \lambda) = 0, \qquad (*)
$$
where $G(N, \hat x, T, C; \lambda) := C - F(N, \hat x, T; \lambda)$. The restriction of $G$ to the level set defined in $(*)$ establishes the **governance surface** of the fault fee and termination fee policies.

## Properties of the governance surface

It is straightforward to verify the following properties of the governance surface $G$ (here we abuse language slightly to use "more negative" to mean "a negative number that increases its absolute value" and "more positive" to mean "a postive number that increases its absolute value", and similarly for "less negative" and "less positive"):
1. The expected penalty $C$ is increasing in the fault fee $N$ (i.e., the more negative $N$ becomes, the more negative $C$ becomes):
$$
\frac{\partial C}{\partial N} = \frac{\partial F}{\partial N} > 0.
$$
2. $C$ is decreasing in the termination fee multiplier $T$ (i.e. the more positive $T$ becomes, the more negative $C$ becomes),
$$
\frac{\partial C}{\partial T} = \frac{\partial F}{\partial T} < 0.
$$
3. $C$ is decreasing in the expected fault duration "down time" $\frac{1}{\lambda}$ (i.e. the more positive the rate $\lambda$ becomes, the less negative $C$ becomes),
$$
\frac{\partial C}{\partial \lambda} = \frac{\partial F}{\partial \lambda} > 0.
$$

When the termination recovery period $\hat x$ is changed, there is a trade-off between accrued fault fees and the termination fee. For example, if $\hat x$ is increased, giving a sector a longer time period within which to recover before having a termination fee assessed, then the lessened chance of a termination fee (lowering its contribution to the expected penalty) may be offset by the increased amount of fault fees that accrue over the longer period. 

The impact of $\hat x$ on the expected penalty $C$ is:
$$
\frac{\partial C}{\partial \hat x} = \frac{\partial F}{\partial \hat x} = N e^{-\lambda \hat x}(\hat x - T).
$$

This ties together the maximum downtime before termination proceeds, $\hat x$, and the amount of the termination fee, $T$. [Incidentally, this reinforces that the units of $T$ are in _time_. This is consistent with the definition of the fault fee $N$, which is in units of _FIL/time_, ensuring that the product $NT$ is in units of _FIL_ (as it is a single lump-sum assessed after $\hat x$.)]

When the maximum downtime $\hat x$ is less than the termination fee $T$, the expected penalty $C$ is less when $\hat x$ is increased slightly--in this situation, the decreased probability of a termination offsets the increased payment of fault fees, and the storage provider benefits from increasing $\hat x$.

By contrast, when $\hat x$ is greater than the termination fee $T$, further increasing $\hat x$ only worsens the expected penalty for the storage provider--the relative change in the probability of termination is too small to offset the increase in fault fees.

When $\hat x = T$, then, there is an equilibrium--to first order, the storage provider would prefer this outcome to deviations away from it, and the marginal impact of a small change in $\hat x$ on the expected penalty is zero.

### Conclusions

1. There is a reduced degree of freedom for setting $(\hat x, T)$ once the value of the fault fee, $N$, has been set, because a stable equilibrium is achieved whenever $\hat x = T$.
2. $T$ is a scaling parameter that, together with $N$, can be set to specify a particular value of the expected penalty $C$ once $\lambda$ has been estimated.
3. The full set of trade-offs can be analytically addressed by examining the combinations that keep the surface $G = 0$ invariant (recall $G(N, \hat x, T, C; \lambda) := C - F(N, \hat x, T; \lambda)$), i.e.
$$
dG = dC - \frac{\partial F}{\partial N}dN - \frac{\partial F}{\partial \hat x}d\hat x - \frac{\partial F}{\partial T}dT \equiv 0, 
$$
which reduces when $\hat x = T$ to
$$
dC - \frac{\partial F}{\partial N}dN - \frac{\partial F}{\partial T}dT \equiv 0.
$$

Selecting any two elements of the vector $(C,N,T)$ will determine the third from the relation $G(N,T,T,C; \hat \lambda) = 0$, where $\hat \lambda$ is the estimated rate parameter from the population.

### Endogenous fee regulation

As introduced in the [Simplified version or auto-adjusting rate](https://hackmd.io/@R02mDHrYQ3C4PFmNaxF5bw/H1LzmEVVF#Simplified-version-or-auto-adjusting-rate) derivation, it is possible to construct functions for $T$ and $N$ that depend upon $\hat \lambda$, such that a desired value for the expected penalty, $C$, remains fixed at a value $C = \bar C$.

Let $\bar G(N, T, \hat \lambda) := G(N,T,T,\bar C;\hat \lambda)$. Then the system $\bar G = 0$ admits a parametrization $(N(\hat \lambda), T(\hat \lambda))$ such that
$$
\bar G(N(\hat \lambda), T(\hat \lambda), \hat \lambda) \equiv 0,
$$
i.e. that for any path taken by $\hat \lambda$ there exist fault fees and termination fees that can change to keep $C = \bar C$. 

Indeed, the implicit function theorem shows that it is sufficient for _either_ $N$ or $T$ to depend upon $\hat \lambda$, and $\bar G = 0$ will be satisfied, since both $\frac{\partial F}{\partial N}$ and $\frac{\partial F}{\partial T}$ are non-zero everywhere. This observation implies that, for example, $T$ (and hence $\hat x$) may be fixed at a value related to other criteria, such as the expected penalty value $\bar C$, and fault fees $N$ can be made to depend upon observed values $\hat \lambda$.


## Notes on termination fee functional form

:::info
### Update given August 24th new termination fee policy

> `NewTF(t) = max(SP(t), max(BR(CC_StartEpoch, 20), BR(Upgrade_StartEpoch, 20)) + max(BR(CC_StartEpoch, 1d), BR(Upgrade_StartEpoch, 1d)) * (1 / 2) * min(sectorAgeFromCCStartInDays, 140))`
>
> - and then we remove `ReplacedDayReward` and `ReplacedSectorAge` from the sector info.
> - There is also no change to `ActivationEpoch` at the time of the upgrade.
> - `max(BR(CC_StartEpoch, 20), BR(Upgrade_StartEpoch, 20))` will be stored.
> - `max(BR(CC_StartEpoch, 1d), BR(Upgrade_StartEpoch, 1d))` will be stored.
:::

The termination fee $TF$ functional form given the above may be expressed as:
\begin{align}
TF := &\max \{ SP(t), B(t) \}, \\
SP(t) := &BR(t,t+\kappa n_1), \\
B(t) := &\max \{ BR(t_0,t_0 + \kappa n_2), BR(t_u,t_u + \kappa n_2) \} + \\
&d \max \{ BR(t_0,t_0 + \kappa),BR(t_u,t_u + \kappa) \} \min \{\frac{t - t_0}{\kappa}, n_3 \}, 
\end{align}
where $t$ is the current time in epochs, $\kappa$ is the number of epochs per day (currently $2880$), $SP(t)$ is the initial storage pledge, $BR(t, t + \kappa\Delta t)$ is the expected block reward over $\Delta t$ days, $t_0$ is the epoch the sector's committed capacity entered the network, $t_u$ is the epoch the sector's committed capacity was upgraded (equals $t_0$ if no upgrade), $n_1 > 0$ is the number of days over which the expected block reward is calculated (currently $20$), $n_2 > 0$ is the number of days from the sector's start epoch (or upgrade epoch) to assess its actual block reward penalty (currently $20$), $n_3 > 0$ is the maximum number of daily block rewards penalized from the sector's start epoch forward (currently $140$), and $d \in (0,1]$ is a weighting factor on daily block reward penalties (currently $1/2$).

The functional form implies that currently $BR(t)$ assesses a maximum of $90$ days' worth of block reward as penalty, divided into a single $20$-day lump sum and a multiple of a maximum of $70$ days' worth of daily block rewards.

**Stakeholder query**: is the Termination Fee $TF$ too low?

Reasons $TF$ could be considered too low:
1. The network is not earning enough revenue from terminations--the cost of termination to the network is too high.
2. Storage providers are terminating sectors at too high a frequency. Reasons termination frequency could be considered too high:
    - The resulting network growth rate is too low for stakeholder objectives.
    - The resulting distribution between committed capacity and deal storage is skewed too far toward committed capacity (i.e. terminated sectors contain disproportionately more deals).
    - The resulting reputation of the network is suffering because termination is a signal of unreliable storage.

### Implications of termination fee selection on fault penalty

As discussed above, one may think of $TF$ as being comprised of two terms, $N$, the fault fee rate, and $T$, an associated multiplier, such that $TF = NT$. This means that, should a fixed termination fee $TF = \overline{TF}$ be desired, but a variable fault fee $N(\hat \lambda)$ be required, then $T(\hat \lambda)$ must also be selected such that
$$
T(\hat \lambda) := \frac{\overline{TF}}{N(\hat \lambda)}.
$$

Suppose that the initial/existing termination fee $TF_0$ is considered to be too low, to e.g. deter manual termination. Increasing $TF_0$ to $\overline{TF} > TF_0$ will, all else held equal, also increase the expected penalty from an automatic termination following a fault, to a value $\bar C > C_0$. Thus, $N(\hat \lambda)$ and $T(\hat \lambda)$ will need to be adjusted in order for $\bar C = C_0$ following the termination fee increase to $\overline{TF}$.

### Incentive impact of adjusting the termination fee functional form

Two discussed changes to the functional form of the termination fee given above have been proposed:
1. Increasing the weighting factor $d$ above $1/2$, essentially adding more daily block reward penalties to $BR(t)$, and
2. Adding a part of the initial consensus pledge $CP(t)$, so that the $SP(t)$ term is modified to e.g.
$$
SP'(t) := \alpha SP(t) + (1-\alpha)CP(t),
$$
where $\alpha \in [0,1]$ is the weight given to the initial storage pledge $SP(t)$ and $(1-\alpha)$ the weight given to the initial consensus pledge $C(t)$.

To assess the incentive impacts of the proposed changes, it would be necessary to understand:
1. The relationship between the funds locked as collateral by a storage miner and the total amount $BR(t)$ for $d = 1$, so understand if sufficient funds are always available if the full $140$ days' daily block reward penalty is assessed;
2. The likelihood that $SP'(t) > BR(t)$ at any given time, so that a mapping between $t$ and when the value of $\alpha$ has an impact can be ascertained. This might be facilitated by existing data on $SP(t)$ and $BR(t)$ across sectors, to understand how often (and under what circumstances) $SP(t) > BR(t)$.


