You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is done by multiplying the `percentage` of obligated tokens by the `balance` of such tokens deposited to the strategy.
28
29
29
-
2.**Sum Obligations**: From `ObligatedBalance`, bApps should sum all obligations and compute the total amount obligated to the bApp by all strategies.
30
+
### 2. **Sum Obligations**
31
+
From `ObligatedBalance`, bApps should sum all obligations and compute the total amount obligated to the bApp by all strategies.
30
32
```go
31
33
TotalBAppBalancemapping(Token -> Amount)
32
34
```
33
-
3.**Calculate Risk**: For each token, it should get the risk (token-over usage) of each strategy. This is obtained by summing all the `percentages` in all `Obligations` for a given token, and dividing it by `100`.
35
+
### 3. **Calculate Risk**
36
+
For each token, it should get the risk (token-over usage) of each strategy. This is obtained by summing all the `percentages` in all `Obligations` for a given token, and dividing it by `100`.
34
37
```go
35
38
Riskmapping(Token -> Strategy -> Float)
36
39
```
37
-
4.**Compute Risk-Aware Weights**: With this information, bApps can compute the weight of a participant for a certain token by
40
+
### 4. **Compute Risk-Aware Weights**
41
+
With this information, bApps can compute the weight of a participant for a certain token by
5.**If the bApp uses validator balance**, the client should also generate a mapping of `Strategy -> Validator Balance` with the amount from each strategy. Clients will need to do this in a couple of steps:
53
+
### 5. **If the bApp uses validator balance**
54
+
The client should also generate a mapping of `Strategy -> Validator Balance` with the amount from each strategy. Clients will need to do this in a couple of steps:
50
55
51
56
a. **Gather Delegated Balances**: Get all the delegations made to the owner of a strategy for all the strategies that opted in to a bApp.
52
57
@@ -68,7 +73,8 @@ For all the strategies that opted-in to a given bApp, clients will need to:
6. **Combine into the Final Weight**: With the per-token weights, the final step is to compute a final weight for the participant using a **combination function**. Such function is defined by the bApp and can be tailored to its specific needs. Traditional examples include the arithmetic mean, geometric mean, and harmonic mean.
76
+
### 6. **Combine into the Final Weight**
77
+
With the per-token weights, the final step is to compute a final weight for the participant using a **combination function**. Such function is defined by the bApp and can be tailored to its specific needs. Traditional examples include the arithmetic mean, geometric mean, and harmonic mean.
72
78
73
79
**Example**: Let's consider a bApp that uses tokens $A$ and $B$, and considers $A$ to be twice as important as $B$. Then, it could use the following weighted harmonic mean as its combination function:
0 commit comments