> For the complete documentation index, see [llms.txt](https://derby-finance.gitbook.io/derby-finance-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://derby-finance.gitbook.io/derby-finance-docs/game/formulas.md).

# Formulas

The formula below is to determine the specific rewards  a user has made between time t=s and t=s+n, calculated per vault the user has locked tokens on in the game:&#x20;

<figure><img src="https://1035724152-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQjZNP5vdWfwhpdHR16Je%2Fuploads%2FMVhVoZQuRbSuGdXDmabL%2FScreenshot%202022-09-20%20at%2016.33.09.png?alt=media&amp;token=42da0272-acda-42b4-bb75-1ee9b09a988c" alt=""><figcaption></figcaption></figure>

where:

<figure><img src="https://1035724152-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQjZNP5vdWfwhpdHR16Je%2Fuploads%2F90jcB5IN76TfbJGFTyA2%2FScreenshot%202022-09-20%20at%2016.36.13.png?alt=media&amp;token=8be74891-ea3c-4aa7-be4d-3848fbb9b206" alt=""><figcaption></figcaption></figure>

and

<figure><img src="https://1035724152-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQjZNP5vdWfwhpdHR16Je%2Fuploads%2FAPk2lj2zeH9DfVAsn1Xa%2FScreenshot%202022-09-20%20at%2016.37.20.png?alt=media&amp;token=8d65c401-a0d9-4373-b7cc-ca53f383adee" alt=""><figcaption><p><br></p></figcaption></figure>

s: Rebalancing period of the vault when the user basket has been created.

n: Number of rebalancing periods of the underlying vaults.

i: Underlying protocol number from whitelist.

Rs,s+n: Rewards build up for a specific user between t=s and t=s+n, in the same currency as Ut when Rs,s+n0.

RLTt,i: Reward per locked token, share of rewards from protocol i at time t per locked token         on a specific vault, in the same currency as Ut when RLTt,i0.

cumRLTt: Cumulative Reward per locked token on time t.

Ai: Allocation on protocol i by game player (in nr of DRB tokens).

Pt,i: Price of protocol LP token i at time t.

PFt: Performance Fee at time t, set by the DAO, currently 10%.

Ut: Total Underlying amount in the vault at time t.

TLTt: Total Locked Tokens, total amount of Derby Tokens (DRB) locked in the game on a vault at time t.

\
To penalize bad behavior, game players receive a small penalty in the form of slashed Derby tokens if the performance of their underlying portfolio is negative. This penalty is computed using a simple formula:

<img src="https://1035724152-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQjZNP5vdWfwhpdHR16Je%2Fuploads%2FhCYveYzJQAzojQTJiN0c%2FScreenshot%202022-11-11%20at%2013.30.10.png?alt=media&amp;token=7c673531-b2ef-4ec6-8c70-ace245072d3b" alt="" data-size="original">

Ps,s+n: Penalty in amount of Derby tokens (DRB) to be slashed

Ed,u: Exchangerate DRB/UnderlyingToken

NRF: Negative Reward Factor (between 0 and 1), not 100% of the negative rewards have to be slashed.
