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
Copy file name to clipboardExpand all lines: core-concepts/bal-balancer-governance-token/bal-for-gas.md
+13-16
Original file line number
Diff line number
Diff line change
@@ -2,42 +2,39 @@
2
2
3
3
Following a 6 week pilot, on March 7th 2021 the Balancer community approved a campaign to increase BAL distribution. To ensure lasting robustness of the governance process, both liquidity providers and traders should have a say in how the protocol evolves.
4
4
5
-
While liquidity providers receive BAL as a function of the amount of liquidity provided in the system, traders earn BAL for swapping tokens on the Balancer Exchange dApp.
5
+
While liquidity providers receive BAL as a function of the amount of liquidity provided in the system, traders earn BAL for swapping tokens on the Balancer Exchange dApp.
6
6
7
7
Every eligible trade made through the Balancer Exchange Proxy results in some BAL being allocated to the address \(EOAs only\) that sent the transaction. An eligible trade is a trade containing one or more eligible swaps, where an eligible swap is one between any two tokens on the [whitelist](https://github.com/balancer-labs/assets/blob/master/lists/eligible.json). Claims are made available at the [BAL claims interface](https://claim.balancer.finance/) on Wednesday \(UTC time\) following the end \(00:00 UTC Monday\) of the weekly period in which the trade occurred.
8
8
9
9
The amount of BAL awarded to a trade is a function of:
10
+
10
11
* the number of eligible swaps in the trade \(N\), which determines a number of gas units \(G\):
11
-
* trades on Balancer V1:
12
-
* 1 swap: `G=130000` gas units
13
-
* 2 swaps: `G=220000` gas units
14
-
* 3 swaps: `G=300000` gas units
15
-
* 4+ swaps: `G=400000` gas units
16
-
* trades on Balancer V2:
17
-
* 1 swap: `G=90000` gas units
18
-
* 2+ swaps: `G=140000` gas units
12
+
* trades on Balancer V1:
13
+
* 1 swap: `G=130000` gas units
14
+
* 2 swaps: `G=220000` gas units
15
+
* 3 swaps: `G=300000` gas units
16
+
* 4+ swaps: `G=400000` gas units
17
+
* trades on Balancer V2:
18
+
* 1 swap: `G=90000` gas units
19
+
* 2+ swaps: `G=140000` gas units
19
20
* the median gas price \[1\] of the block the transaction was included in \(M\); and
20
21
* the BAL/ETH price provided by the CoinGecko closest to the block time \(P\).
21
22
22
-
The amount of BAL to be received by the user for a trade is computed as `G*M/P`
23
+
The amount of BAL to be received by the user for a trade is computed as `G*M/P`
23
24
24
25
Because this program only partially covers gas costs \(with very specific caps to prevent attempts at gaming the system\), and doesn’t cover trading fees, it does not incentivize wash trading or trading any more than a user was initially planning. Estimates are provided on the UI, but actual values are computed off-chain weekly using an [open source script](https://github.com/balancer-labs/bal-mining-scripts/), so that any suspicious activity can be filtered out.
25
26
26
27
80,000 BAL from the Ecosystem Fund have been allocated to the “BAL for Gas’’ campaign, starting on March 8th 2021. There is no fixed time period; the budget is consumed on a first-come, first-served basis. When the budget is exhausted, the campaign is suspended until it is replenished by BAL governance.
27
28
28
-
###Notes
29
+
## Notes
29
30
30
31
\[1\] Transactions sent by the miner of the block or having a gas price of 10 Gwei or less are not considered for the purposes of determining the median gas price of the block
31
32
32
-
###References
33
+
## References
33
34
34
35
*[BAL for Gas proposal](https://forum.balancer.finance/t/proposal-bal-for-gas/1437)
35
36
*[Original pilot](https://forum.balancer.finance/t/proposal-balancer-exchange-gas-reimbursement/705) and [Expansion of the list of eligible tokens](https://forum.balancer.finance/t/proposal-expand-the-exchange-gas-reimbursement-to-all-whitelisted-tokens/799)
36
37
*[Extension of the pilot, 30k BAL budget](https://forum.balancer.finance/t/proposal-extend-the-exchange-gas-reimbursement-program-4-weeks/1121)
37
38
*[Additional 50k BAL budget](https://forum.balancer.fi/t/proposal-bal-for-gas-replenish-budget-w-50-000-bal/1695)
38
39
*[BAL for Gas on V2 params](https://forum.balancer.fi/t/proposal-bal-for-gas-on-balancer-v2/1861)
Copy file name to clipboardExpand all lines: core-concepts/bal-liquidity-mining/liquidity-mining-estimates-api.md
+70-208
Original file line number
Diff line number
Diff line change
@@ -2,30 +2,28 @@
2
2
3
3
## Liquidity Mining Estimates API
4
4
5
-
Estimated BAL earned at each pool and by each liquidity provider can be retrieved via this API. Cumulative estimates for the week in progress are computed every hour, and the velocity with each BAL is accruing is computed from the difference between two consecutive estimates. Clients can then use the velocity to update the estimates retrieved from the API.
5
+
This API provides an estimate amount of tokens earned by a liquidity provider at the current week \(and previous week if tokens weren't sent out yet\). Cumulative estimates for the week in progress are computed every hour, and the velocity with each tokens are being accrued is computed from the difference between two consecutive estimates. Clients can then use the velocity to update in real time the estimates retrieved from the API.
6
6
7
-
## Retrieving Pool Data
8
-
9
-
These endpoints can be used to fetch the aggregate amount of BAL mined by all the liquidity providers of a pool or a set of pools.
7
+
## Retrieving Liquidity Provider Data
10
8
11
-
### Single Pool
9
+
### Single Liquidity Provider
12
10
13
11
#### HTTP Request
14
12
15
13
```jsx
16
-
GET https://api.balancer.finance/liquidity-mining/v1/pool/:address
14
+
GET https://api.balancer.finance/liquidity-mining/v1/liquidity-provider-multitoken/:address
17
15
```
18
16
19
17
#### URL Parameters
20
18
21
19
| Param | Description | Required |
22
20
| :--- | :--- | :--- |
23
-
| address | The address of the pool| TRUE |
21
+
| address | The address of the liquidity provider| TRUE |
| success |`false` if an error occurred, `true` otherwise |
256
117
| current\_timestamp | The timestamp of when the request was received by the server |
257
118
| snapshot\_timestamp | The last time the mining estimator script was executed and velocity was determined |
258
-
| address | The address of the pool or the liquidity provider, depending on the endpoint used |
259
-
| velocity | The estimated rate, in `BAL/second`, at which BAL was being mined by the address last time the estimator script was run |
260
-
| current\_estimate | The estimated total BAL mined in the `week` up to time `current_timestamp`|
119
+
| address | The address of the liquidity provider |
120
+
| token\_address | The address of the token received as incentive for liquidity provided |
121
+
| chain\_id | The ID of the chain in which liquidity was provided |
122
+
| velocity | The estimated rate, in`tokens/second`, at which tokens were being mined by the address at the last time the estimator script was run |
123
+
| current\_estimate | The estimated total amount of `token` mined by `address` in the `week` up to time `current_timestamp`|
261
124
| week | The number of the week that the estimates refer to, `1` being the week between `Jun-01-2020 00:00:00` and `Jun-07-2020 23:59:59`|
262
125
263
126
## Client side updates
264
127
265
-
Clients can update the real time estimate by increasing the `current_estimate` retrieved from the API by `velocity` every second. The underlying data served by the API is updated every other hour, but it takes about 40 minutes to run the script, so clients should not expect any changes before at least 160 minutes have passed since `snapshot_timestamp`.
128
+
Clients can update the real time estimate by increasing the `current_estimate` retrieved from the API by `velocity` every second. The underlying data served by the API is updated every other hour, but it takes about 10 minutes to run the script, so clients should not expect any changes before at least 70 minutes have passed since `snapshot_timestamp`.
266
129
267
130
## Notes
268
131
269
-
* Estimates are approximate, as the actual mining script relies on a set of snapshot blocks that can only be determined after the end of the week.
270
-
* Liquidity providers estimates take into account the govFactor; pools estimates do not.
132
+
* Estimates are approximate, as they do not account for liquidity added/removed since the last time the script was run.
271
133
* The API only provides estimates for weeks that have not yet been finalized; as soon as the estimator script detects that the previous weeks claims have been [made available](https://ipfs.fleek.co/ipns/balancer-team-bucket.storage.fleek.co/balancer-claim/snapshot), the estimates for that week are removed from the underlying dataset.
0 commit comments