# Strategies boost algorithm

### **ATTENTION! The project has been shut down! Details can be found at:**

<https://cadabra.gitbook.io/v2/articles/announcement-of-cadabra-finance-stopping>

### **Everything written below on this and all other pages is no longer relevant and is provided for historical information only. If you continue to use the project website or its smart contracts, you do so at your own risk.**

The boost algorithm is as follows:

After each liquidity addition, a user's fixed pool share is calculated as:

$$
S\_u=\frac{LP\_{deposit}}{TVL}
$$

Where $$LP\_{deposit}$$ is the value of deposited tokens and $$TVL$$ is the value of all pools across all chains.

If the user already has a non-zero $$S\_u^{}$$ then the new share is added to the old one:&#x20;

$$
S\_u^{'} = S\_u + \frac{LP\_{deposit}}{TVL}
$$

If the user withdraws $$LP\_w$$ amount of tokens out of his total $$LP\_u$$ amount of liquidity then the $$S\_u$$ is updated accordingly:

$$
S\_u^{'}=S\_u\frac{LP\_w}{LP\_u}
$$

At any moment of time a user's working balance is defined as:

$$
WB\_u = S\_u \cdot TVL
$$

At the end of a reporting period (one day), we have:

* $$WB\_u$$ — the time-weighted value of the working balance of the user **u**;&#x20;
* $$D\_{u,s}$$ — the time-weighted value of the deposit by the same user in strategy **s**;&#x20;
* $$APR\_s$$ — the annual percentage rate (APR) of strategy **s**

The user's total allocation over which the boost value calculated is:

$$
D\_{u} = \sum\_{s} D\_{u,s}
$$

### **1. User Boost Factor**

$$
\beta\_{u} = \min\left(1,; \frac{WB\_{u}}{D\_{u}}\right)
$$

* 10k in the pool and 100k in strategies → β = 0.1.
* 20k in the pool (or more) and 20k in strategies → β = 1 (full boost).

### **2. User–Strategy Position Weight**

$$
W\_{u,s} = D\_{u,s} \cdot APR\_{s} \cdot \beta\_{u}
$$

* APR sets the priority between strategies.
* A single β applies to all of a user's strategies.

### **3. Token Distribution**

Let $$R$$ be the total amount of tokens to be distributed during the period.\
Total weight:

$$
W\_{\text{tot}} = \sum\_{u} \sum\_{s} W\_{u,s}
$$

The reward that should be allocated to a user for a specific strategy:

$$
\text{Reward}*{u,s} = R \cdot \frac{W*{u,s}}{W\_{\text{tot}}}
$$

If the allocated reward exceeds the reward corresponding to the baseline APR, it is capped at the baseline reward amount:

$$
\text{Reward}^\text{baseline}*{u,s} = \min\left(\text{Reward}*{u,s},; D\_{u,s} \cdot APR\_{s} \right)
$$

The algorithm starts with the users with the highest $$W\_{u,s}$$, in the case where their reward exceeds the baseline the leftover tokens are simply counted towards the remaining $$R$$<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cadabra.gitbook.io/v2/articles/strategies-boost-algorithm.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
