# gVires Math

### VIRES, gVires & Half-life <a href="#vires-gvires-amp-half-life" id="vires-gvires-amp-half-life"></a>

The core of math is simple: At any time, accounts lose half of their current commitment in 6 months. The algorithm is based on a [half-life decay formula](https://en.wikipedia.org/wiki/Half-life):

Given a user $$u$$ commits $$V\_{u, t\_0}$$ Vires tokens at time $$t\_0$$,

$$
gVires\_{(u,t)} = V\_{u, t\_0} \* e^{-\lambda(t-t\_0)}
$$

where $$\lambda$$ indicates the decay speed(half-life time):

$$
\lambda = ln(2) / 180 / 1440 = 0.00000267417
$$

### Example for 1 particpant

For example, a user X1-locked 100 Vires on Jan 1, 2022. The user’s governance power starts decaying; his tokens start to unlock:

| Date                   | gVires            | Still locked VIRES | Unlocked VIRES |
| ---------------------- | ----------------- | ------------------ | -------------- |
| **Jan 1, 2022, 00:00** | **100.00 gVires** | **100.00 ⓥ**       | **0.00 ⓥ**     |
| Feb 1, 2022            | 89.09 gVires      | 89.09 ⓥ            | 10.91 ⓥ        |
| Mar 1, 2022            | 79.37 gVires      | 79.37 ⓥ            | 20.63 ⓥ        |
| Apr 1, 2022            | 70.71 gVires      | 70.71 ⓥ            | 29.29 ⓥ        |
| May 1, 2022            | 63.00 gVires      | 63.00 ⓥ            | 37.00 ⓥ        |
| June 1, 2022           | 56.12 gVires      | 56.12 ⓥ            | 43.88 ⓥ        |
| **July 1, 2022**       | **50.00 gVires**  | **50.00 ⓥ**        | **50.00 ⓥ**    |
| …                      | …                 | …                  | …              |
| Jan 1, 2023            | 25.00 gVires      | 25.00 ⓥ            | 75.00 ⓥ        |
| …                      | …                 | …                  | …              |
| July 1, 2023           | 12.50 gVires      | 12.50 ⓥ            | 87.50 ⓥ        |
| …                      | …                 | …                  | …              |
| **Jan 1, 2024, 00:00** | **6.25 gVires**   | **0.00 ⓥ**         | **100 ⓥ**      |
| …                      | …                 | …                  | …              |

![](https://i.imgur.com/w4zbi7W.png)

As illustrated above,

* The unlock starts immediately after locking VIRES,
* In half a year, the users’s amount of gVires gets halved; also, half of VIRES is free to be withdrawn,
* *In two years, there’s a cliff: user can withdraw all the rest vires now(6.25% of initial lock), although if he doesn’t do it, he still has the voting, governance, and revenue stream power(under the continued decay)*;

### Example for multiple participants

Vires.finance markets take a cut of the interest that borrowers pay. The ‘Protocol share’ value can be found under any asset on the asset details page. Generally, it can be different for different markets, and this value is up to governance to configure. Let’s look at an example:

* Borrowers on the USDC market have borrowed 100M USC for 36.5% APR,
* Therefore, borrowers on the USDC market have to pay 100,000 USDC of interest today,
* Protocol share for USDC is 10%; therefore, governance receive 10,000 USDC today,
* Alice and Bob locked **100 VIRES** each yesterday, totaling 200 gVires(by 100 gVires each), so Alice and Bob both received 5,000 USDC today;

Day 0:

| user  | VIRES in the system | Still locked VIRES = gVires | Already unlocked VIRES | gVires | Revenue share |
| ----- | ------------------- | --------------------------- | ---------------------- | ------ | ------------- |
| Alice | 100 ⓥ               | 100 ⓥ                       | 0 ⓥ                    | 100    | 50%           |
| Bob   | 100 ⓥ               | 100 ⓥ                       | 0 ⓥ                    | 100    | 50%           |

Now, after half a year, all the gVires have decayed:

* Alice accounts for 50 gVires, Bob accounts for 50 gVires(of now total 100), so they still split the revenue stream 50-50%,

| user  | VIRES in the system | Still locked VIRES = gVires | Already unlocked VIRES | gVires | Revenue share |
| ----- | ------------------- | --------------------------- | ---------------------- | ------ | ------------- |
| Alice | 100 ⓥ               | 50 ⓥ                        | 50 ⓥ                   | 50     | 50%           |
| Bob   | 100 ⓥ               | 50 ⓥ                        | 50 ⓥ                   | 50     | 50%           |

![](https://i.imgur.com/SoQrrsS.png)

* Dave comes in and locks **100 VIRES**, which grants him 100 gVires:

| user  | VIRES in the system | Still locked VIRES = gVires | Already unlocked VIRES | gVires | Revenue share |
| ----- | ------------------- | --------------------------- | ---------------------- | ------ | ------------- |
| Alice | 100 ⓥ               | 50 ⓥ                        | 50 ⓥ                   | 50     | 25%           |
| Bob   | 100 ⓥ               | 50 ⓥ                        | 50 ⓥ                   | 50     | 25%           |
| Dave  | 100 ⓥ               | 100 ⓥ                       | 0 ⓥ                    | 100    | 50%           |

Dave commits twice more than Alice, so he receives twice more than her in revenue: This day, — Alice receives 2500 USDC, — Bob receives 2500 USDC, — Dave receives 5000 USDC;

![](https://i.imgur.com/wSssPpU.png)

As illustrated in the examples, gVires is proportional to the total amount of VIRES still locked by a given user.

At any time, anyone else can re-lock their stake.

Here’s how the picture changes if Alice decides to re-lock her VIRES:

| user  | VIRES in the system | Still locked VIRES | Already unlocked VIRES | gVires | Revenue share |
| ----- | ------------------- | ------------------ | ---------------------- | ------ | ------------- |
| Alice | 100 ⓥ               | 100 ⓥ              | 0 ⓥ                    | 100    | 40%           |
| Bob   | 100 ⓥ               | 50 ⓥ               | 50 ⓥ                   | 50     | 20%           |
| Dave  | 100 ⓥ               | 100 ⓥ              | 0 ⓥ                    | 100    | 40%           |

![](https://i.imgur.com/8iNGrsA.png)

### &#x20;<a href="#deprecation-of-vires-staking" id="deprecation-of-vires-staking"></a>


---

# 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://docs.vires.finance/faq/w-governance/gvires-math.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.
