@raac/rpc 1.2.0-beta.6 → 1.2.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/configs/chains/11155111.json +55 -25
- package/dist/contracts/governance/gaugeController/getGaugeEmissions.js +136 -0
- package/dist/contracts/governance/gaugeController/index.js +1 -0
- package/dist/types/contracts/governance/gaugeController/getGaugeEmissions.d.ts +51 -0
- package/dist/types/contracts/governance/gaugeController/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"raachouseprices": {
|
|
18
18
|
"id": "raachouseprices",
|
|
19
19
|
"name": "RAAC House Prices",
|
|
20
|
-
"contract": "
|
|
20
|
+
"contract": "0x96EBC781867cF33F0Fac64e44388CBF065c78e92"
|
|
21
21
|
},
|
|
22
22
|
"auctionfactory": {
|
|
23
23
|
"id": "auctionfactory",
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
"feecollector": {
|
|
38
38
|
"id": "feecollector",
|
|
39
39
|
"name": "Fee Collector",
|
|
40
|
-
"contract": "
|
|
40
|
+
"contract": "0xf460b2436753AEed5Df275CA33528f5C9abB579D"
|
|
41
41
|
},
|
|
42
42
|
"treasury": {
|
|
43
43
|
"id": "treasury",
|
|
44
44
|
"name": "Treasury",
|
|
45
|
-
"contract": "
|
|
45
|
+
"contract": "0xDc1FCd959881533CCFBfB572881CdC6d8a2b35E7"
|
|
46
46
|
},
|
|
47
47
|
"pmtreasury": {
|
|
48
48
|
"id": "pmtreasury",
|
|
@@ -72,17 +72,17 @@
|
|
|
72
72
|
"rwavault": {
|
|
73
73
|
"id": "rwavault",
|
|
74
74
|
"name": "RWA Vault",
|
|
75
|
-
"contract": "
|
|
75
|
+
"contract": "0xEC9e67e9b6ceD5e48b5Dd39915414e7BbDf952f2"
|
|
76
76
|
},
|
|
77
77
|
"complianceregistry": {
|
|
78
78
|
"id": "complianceregistry",
|
|
79
79
|
"name": "Compliance Registry",
|
|
80
|
-
"contract": "
|
|
80
|
+
"contract": "0x95bc6FCfB69BDbF723De06bCa1a689ad68762CC5"
|
|
81
81
|
},
|
|
82
82
|
"rwaindextokencollector": {
|
|
83
83
|
"id": "rwaindextokencollector",
|
|
84
84
|
"name": "RWA Index Token Collector",
|
|
85
|
-
"contract": "
|
|
85
|
+
"contract": "0xdbEd45218e5c040Cdf696C740937997162cFb720"
|
|
86
86
|
},
|
|
87
87
|
"raactokencollector": {
|
|
88
88
|
"id": "raactokencollector",
|
|
@@ -92,17 +92,17 @@
|
|
|
92
92
|
"raachousepriceoracle": {
|
|
93
93
|
"id": "raachousepriceoracle",
|
|
94
94
|
"name": "RAAC House Price Oracle",
|
|
95
|
-
"contract": "
|
|
95
|
+
"contract": "0x8C881051D397014E6D4ea711764E6875506d88D1"
|
|
96
96
|
},
|
|
97
97
|
"raacprimerateoracle": {
|
|
98
98
|
"id": "raacprimerateoracle",
|
|
99
99
|
"name": "RAAC Prime Rate Oracle",
|
|
100
|
-
"contract": "
|
|
100
|
+
"contract": "0x312F47A51F398C6504B31794dfCf604acF174c67"
|
|
101
101
|
},
|
|
102
102
|
"crvusdtousdoracle": {
|
|
103
103
|
"id": "crvusdtousdoracle",
|
|
104
104
|
"name": "CRVUSD to USD Oracle",
|
|
105
|
-
"contract": "
|
|
105
|
+
"contract": "0x627897baf46851500F116cec76346921C3292246"
|
|
106
106
|
}
|
|
107
107
|
},
|
|
108
108
|
"governance": {
|
|
@@ -146,12 +146,12 @@
|
|
|
146
146
|
"stabilitypool": {
|
|
147
147
|
"id": "stabilitypool",
|
|
148
148
|
"name": "Stability Pool",
|
|
149
|
-
"contract": "
|
|
149
|
+
"contract": "0xd7663c079445A070Ef24405CD5ef1511B9d9E060"
|
|
150
150
|
},
|
|
151
151
|
"lendingpool": {
|
|
152
152
|
"id": "lendingpool",
|
|
153
153
|
"name": "Lending Pool",
|
|
154
|
-
"contract": "
|
|
154
|
+
"contract": "0xefCff23AEed94ae0f23377DFDaB78C3c868eeB33"
|
|
155
155
|
},
|
|
156
156
|
"crvusdraacpool": {
|
|
157
157
|
"id": "crvusdraacpool",
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
"raacnft": {
|
|
164
164
|
"id": "raacnft",
|
|
165
165
|
"name": "RAAC NFT",
|
|
166
|
-
"contract": "
|
|
166
|
+
"contract": "0xb16453caAFF3c75e9D090793dD60C46668c1de52"
|
|
167
167
|
},
|
|
168
168
|
"raacbotnft": {
|
|
169
169
|
"id": "raacbotnft",
|
|
@@ -194,19 +194,19 @@
|
|
|
194
194
|
"id": "crvusd",
|
|
195
195
|
"name": "CRVUSD",
|
|
196
196
|
"decimals": 18,
|
|
197
|
-
"contract": "
|
|
197
|
+
"contract": "0x8047a14301583CAaf9e2128D5F88F9f435659d35"
|
|
198
198
|
},
|
|
199
199
|
"rtoken": {
|
|
200
200
|
"id": "rtoken",
|
|
201
201
|
"name": "RToken",
|
|
202
202
|
"decimals": 18,
|
|
203
|
-
"contract": "
|
|
203
|
+
"contract": "0xc96c34825aa96A77A4AD884e393960a70c5f1186"
|
|
204
204
|
},
|
|
205
205
|
"detoken": {
|
|
206
206
|
"id": "detoken",
|
|
207
207
|
"name": "DEToken",
|
|
208
208
|
"decimals": 18,
|
|
209
|
-
"contract": "
|
|
209
|
+
"contract": "0x5841dc06d2C9e0D2605392f669be71Bfe6d04cf7"
|
|
210
210
|
},
|
|
211
211
|
"raactoken": {
|
|
212
212
|
"id": "raactoken",
|
|
@@ -230,13 +230,13 @@
|
|
|
230
230
|
"id": "debttoken",
|
|
231
231
|
"name": "Debt Token",
|
|
232
232
|
"decimals": 18,
|
|
233
|
-
"contract": "
|
|
233
|
+
"contract": "0x98db917a623a92a8553Fe59b9f05B8c936aa1E1e"
|
|
234
234
|
},
|
|
235
235
|
"rwaindextoken": {
|
|
236
236
|
"id": "rwaindextoken",
|
|
237
237
|
"name": "RWA Index Token",
|
|
238
238
|
"decimals": 18,
|
|
239
|
-
"contract": "
|
|
239
|
+
"contract": "0x1c1789629B2511821aC78618eBd23d41E7b04989"
|
|
240
240
|
}
|
|
241
241
|
},
|
|
242
242
|
"adapters": {
|
|
@@ -244,13 +244,13 @@
|
|
|
244
244
|
"raacnftadapter": {
|
|
245
245
|
"id": "raacnftadapter",
|
|
246
246
|
"name": "RAAC NFT Adapter",
|
|
247
|
-
"contract": "
|
|
247
|
+
"contract": "0x608aD2608DAdDb633ceBe22d6Fcb7C9e660FfA65",
|
|
248
248
|
"type": "ERC721"
|
|
249
249
|
},
|
|
250
250
|
"rwaindextokenadapter": {
|
|
251
251
|
"id": "rwaindextokenadapter",
|
|
252
252
|
"name": "RWA Index Token",
|
|
253
|
-
"contract": "
|
|
253
|
+
"contract": "0x5374287a807c5513fC31bc9AECE5aC40f0e37c71",
|
|
254
254
|
"type": "ERC20"
|
|
255
255
|
}
|
|
256
256
|
},
|
|
@@ -258,7 +258,7 @@
|
|
|
258
258
|
"raacnftadapter": {
|
|
259
259
|
"id": "raacnftadapter",
|
|
260
260
|
"name": "RAAC NFT Adapter",
|
|
261
|
-
"contract": "
|
|
261
|
+
"contract": "0x531F5d54Fda86f103E297ECE796c8B799B835E0c",
|
|
262
262
|
"type": "ERC721"
|
|
263
263
|
},
|
|
264
264
|
"crvusdadapter": {
|
|
@@ -294,19 +294,49 @@
|
|
|
294
294
|
}
|
|
295
295
|
},
|
|
296
296
|
"gauges": {
|
|
297
|
+
"raac_pmusd": {
|
|
298
|
+
"id": "RAAC_pmUSD",
|
|
299
|
+
"name": "RAAC pmUSD Gauge",
|
|
300
|
+
"type": "RAACGauge",
|
|
301
|
+
"contract": "0xc6471c956a6f77Af1D35Ea639a46544eE9340838",
|
|
302
|
+
"stakingToken": "0x0bd4E860e5e7A0C7c9d221Fa336976bF001F81fa",
|
|
303
|
+
"wrapped": true,
|
|
304
|
+
"underlying": "0x6F713079002a0a485E91fB276E4682CB01d18439",
|
|
305
|
+
"wrapper": "0x0bd4E860e5e7A0C7c9d221Fa336976bF001F81fa"
|
|
306
|
+
},
|
|
307
|
+
"raac_pmusd_lp": {
|
|
308
|
+
"id": "RAAC_pmUSD_LP",
|
|
309
|
+
"name": "RAAC pmUSD/RAAC LP Gauge",
|
|
310
|
+
"type": "RAACGauge",
|
|
311
|
+
"contract": "0xac6A07DEbbc683042478987f7BceEdb934161311",
|
|
312
|
+
"stakingToken": "0xAe98A7EF8557491fD34b45036Aada075c9385c6C"
|
|
313
|
+
},
|
|
297
314
|
"raac_rcrvusd": {
|
|
298
315
|
"id": "RAAC_RcrvUSD",
|
|
299
|
-
"name": "RAAC RcrvUSD Gauge",
|
|
316
|
+
"name": "RAAC RcrvUSD Gauge (deprecated)",
|
|
300
317
|
"type": "RAACGauge",
|
|
301
|
-
"contract": "
|
|
302
|
-
"stakingToken": "
|
|
318
|
+
"contract": "0xc6e49678e7a7D797Cb11EE5D2834A3896200096D",
|
|
319
|
+
"stakingToken": "0xa610498F28448Eb379BFD3179381F6f094ad110b",
|
|
320
|
+
"wrapped": true,
|
|
321
|
+
"underlying": "0x062a641EF54810B321f123487fFf083cadB50989",
|
|
322
|
+
"wrapper": "0xa610498F28448Eb379BFD3179381F6f094ad110b",
|
|
323
|
+
"_note": "Deprecated — being removed from the controller (replaced by raac_pmusd). Reclaim stuck votes via removePowerFromGauge."
|
|
303
324
|
},
|
|
304
325
|
"raac_crvusd_lp": {
|
|
305
326
|
"id": "RAAC_crvUSD_LP",
|
|
306
|
-
"name": "RAAC crvUSD/RAAC LP Gauge",
|
|
327
|
+
"name": "RAAC crvUSD/RAAC LP Gauge (deprecated)",
|
|
307
328
|
"type": "RAACGauge",
|
|
308
329
|
"contract": "0x04F3e12A814b21B9F947c726be512719a41b980f",
|
|
309
|
-
"stakingToken": "0xCfDBbad91770fb7Fd57e623A59dcbD14670164c7"
|
|
330
|
+
"stakingToken": "0xCfDBbad91770fb7Fd57e623A59dcbD14670164c7",
|
|
331
|
+
"_note": "Deprecated — being removed from the controller (replaced by raac_pmusd_lp). Reclaim stuck votes via removePowerFromGauge."
|
|
332
|
+
},
|
|
333
|
+
"raac_rcrvusd_old": {
|
|
334
|
+
"id": "RAAC_RcrvUSD_old",
|
|
335
|
+
"name": "RAAC RcrvUSD Gauge (raw rebasing, removed)",
|
|
336
|
+
"type": "RAACGauge",
|
|
337
|
+
"contract": "0xE8eBe8294542d47f481c17036C8165CB8935554a",
|
|
338
|
+
"stakingToken": "0x062a641EF54810B321f123487fFf083cadB50989",
|
|
339
|
+
"_note": "Already removed from controller. Reclaim stuck votes via removePowerFromGauge."
|
|
310
340
|
}
|
|
311
341
|
}
|
|
312
342
|
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getGaugeEmissions = void 0;
|
|
7
|
+
const ethers_1 = require("ethers");
|
|
8
|
+
const chains_1 = __importDefault(require("../../../configs/chains"));
|
|
9
|
+
const getContractAddress_1 = require("../../getContractAddress");
|
|
10
|
+
const artifacts_1 = require("../../../utils/artifacts");
|
|
11
|
+
const E18 = 10n ** 18n;
|
|
12
|
+
/**
|
|
13
|
+
* Per-epoch emissions actually received by a gauge: the GaugeController snapshots
|
|
14
|
+
* gauge weights per epoch, and the GaugeRewardsDistributor records the RAAC deposited
|
|
15
|
+
* per epoch. A gauge's emission for an epoch is therefore
|
|
16
|
+
* depositedAtEpoch(epoch) × gaugeRelativeWeight(gauge, epoch).
|
|
17
|
+
*
|
|
18
|
+
* Returns a series ending at the current (in-progress) epoch so callers can chart
|
|
19
|
+
* "week of X → this gauge received Y RAAC".
|
|
20
|
+
*
|
|
21
|
+
* @param chainId - The chain/network to use.
|
|
22
|
+
* @param gauge - Gauge address (or config key).
|
|
23
|
+
* @param numEpochs - How many epochs to include, ending at the current one (default 8).
|
|
24
|
+
* @param provider - Optional ethers.js Provider instance.
|
|
25
|
+
*/
|
|
26
|
+
const getGaugeEmissions = async (chainId, gauge, numEpochs = 8, includeUpcoming = true, provider) => {
|
|
27
|
+
if (!provider) {
|
|
28
|
+
const rpc = chains_1.default[chainId].rpcs[0];
|
|
29
|
+
provider = new ethers_1.ethers.JsonRpcProvider(rpc);
|
|
30
|
+
}
|
|
31
|
+
const controller = new ethers_1.ethers.Contract((0, getContractAddress_1.getContractAddress)(chainId, "gaugecontroller"), (0, artifacts_1.getABI)("gaugecontroller"), provider);
|
|
32
|
+
const distributor = new ethers_1.ethers.Contract((0, getContractAddress_1.getContractAddress)(chainId, "gaugerewardsdistributor"), (0, artifacts_1.getABI)("gaugerewardsdistributor"), provider);
|
|
33
|
+
const [weekBn, currentEpochBn, startEpochBn, rewardToken] = await Promise.all([
|
|
34
|
+
controller.WEEK(),
|
|
35
|
+
controller.getCurrentEpoch(),
|
|
36
|
+
distributor.startEpoch(),
|
|
37
|
+
distributor.rewardToken(),
|
|
38
|
+
]);
|
|
39
|
+
const week = BigInt(weekBn);
|
|
40
|
+
const currentEpoch = BigInt(currentEpochBn);
|
|
41
|
+
const startEpoch = BigInt(startEpochBn) > 0n ? BigInt(startEpochBn) : currentEpoch;
|
|
42
|
+
// Window: [currentEpoch - (numEpochs-1)*week .. currentEpoch], clamped to startEpoch.
|
|
43
|
+
const span = BigInt(Math.max(1, numEpochs) - 1) * week;
|
|
44
|
+
let from = currentEpoch - span;
|
|
45
|
+
if (from < startEpoch)
|
|
46
|
+
from = startEpoch;
|
|
47
|
+
const epochList = [];
|
|
48
|
+
for (let e = from; e <= currentEpoch; e += week)
|
|
49
|
+
epochList.push(e);
|
|
50
|
+
const epochs = await Promise.all(epochList.map(async (e) => {
|
|
51
|
+
let deposited = 0n;
|
|
52
|
+
let relativeWeight = 0n;
|
|
53
|
+
try {
|
|
54
|
+
deposited = BigInt(await distributor.depositedAtEpoch(rewardToken, e));
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
/* ignore */
|
|
58
|
+
}
|
|
59
|
+
try {
|
|
60
|
+
const [rel] = await controller.getGaugeRelativeWeightView(gauge, e);
|
|
61
|
+
relativeWeight = BigInt(rel);
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
/* no snapshot at this epoch */
|
|
65
|
+
}
|
|
66
|
+
const gaugeEmissionRaw = (deposited * relativeWeight) / E18;
|
|
67
|
+
return {
|
|
68
|
+
epoch: Number(e),
|
|
69
|
+
deposited: ethers_1.ethers.formatEther(deposited),
|
|
70
|
+
relativeWeight,
|
|
71
|
+
relativeWeightPct: Number((relativeWeight * 10000n) / E18) / 100,
|
|
72
|
+
gaugeEmission: ethers_1.ethers.formatEther(gaugeEmissionRaw),
|
|
73
|
+
gaugeEmissionRaw,
|
|
74
|
+
isCurrent: e === currentEpoch,
|
|
75
|
+
};
|
|
76
|
+
}));
|
|
77
|
+
const current = epochs[epochs.length - 1];
|
|
78
|
+
// ── Upcoming-epoch preview ────────────────────────────────────────────────
|
|
79
|
+
// Votes cast this epoch take effect at nextEpoch, so getGaugeRelativeWeightView
|
|
80
|
+
// at nextEpoch already reflects current voting. Nothing is deposited yet, so we
|
|
81
|
+
// project the distributor's deposit from the emission schedule:
|
|
82
|
+
// projectedSystem = minterWeekly(nextEpoch) × distributorShareOfMinter
|
|
83
|
+
// projectedGauge = projectedSystem × gaugeRelativeWeight(nextEpoch)
|
|
84
|
+
if (includeUpcoming) {
|
|
85
|
+
const nextEpoch = currentEpoch + week;
|
|
86
|
+
let relNext = 0n;
|
|
87
|
+
let minterWeekly = 0n;
|
|
88
|
+
let distShare = 0n; // 1e18-scaled fraction of the minter routed to the distributor
|
|
89
|
+
try {
|
|
90
|
+
const [rel] = await controller.getGaugeRelativeWeightView(gauge, nextEpoch);
|
|
91
|
+
relNext = BigInt(rel);
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
/* no projected snapshot */
|
|
95
|
+
}
|
|
96
|
+
try {
|
|
97
|
+
const minter = new ethers_1.ethers.Contract((0, getContractAddress_1.getContractAddress)(chainId, "raacminter"), (0, artifacts_1.getABI)("raacminter"), provider);
|
|
98
|
+
minterWeekly = BigInt(await minter.calculateScheduledMintableAmount(nextEpoch, nextEpoch + week));
|
|
99
|
+
// distributor's share of the minter's weighted distribution
|
|
100
|
+
const distAddr = (0, getContractAddress_1.getContractAddress)(chainId, "gaugerewardsdistributor");
|
|
101
|
+
const [info, totalWeight] = await Promise.all([
|
|
102
|
+
minter.poolInfo(distAddr),
|
|
103
|
+
minter.totalWeight(),
|
|
104
|
+
]);
|
|
105
|
+
const poolWeight = BigInt(info.weight ?? info[0] ?? 0n);
|
|
106
|
+
const exists = Boolean(info.exists ?? info[1]);
|
|
107
|
+
const tw = BigInt(totalWeight);
|
|
108
|
+
distShare = exists && tw > 0n ? (poolWeight * E18) / tw : 0n;
|
|
109
|
+
}
|
|
110
|
+
catch {
|
|
111
|
+
/* minter not readable — projection stays 0 */
|
|
112
|
+
}
|
|
113
|
+
const projectedSystem = (minterWeekly * distShare) / E18;
|
|
114
|
+
const projectedRaw = (projectedSystem * relNext) / E18;
|
|
115
|
+
epochs.push({
|
|
116
|
+
epoch: Number(nextEpoch),
|
|
117
|
+
deposited: ethers_1.ethers.formatEther(projectedSystem),
|
|
118
|
+
relativeWeight: relNext,
|
|
119
|
+
relativeWeightPct: Number((relNext * 10000n) / E18) / 100,
|
|
120
|
+
gaugeEmission: ethers_1.ethers.formatEther(projectedRaw),
|
|
121
|
+
gaugeEmissionRaw: projectedRaw,
|
|
122
|
+
isCurrent: false,
|
|
123
|
+
isProjected: true,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
return {
|
|
127
|
+
gauge,
|
|
128
|
+
rewardToken,
|
|
129
|
+
currentEpoch: Number(currentEpoch),
|
|
130
|
+
weekSeconds: Number(week),
|
|
131
|
+
relativeWeightPct: current ? current.relativeWeightPct : 0,
|
|
132
|
+
currentWeekEmission: current ? current.gaugeEmission : "0",
|
|
133
|
+
epochs,
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
exports.getGaugeEmissions = getGaugeEmissions;
|
|
@@ -25,6 +25,7 @@ __exportStar(require("./getCurrentEpoch"), exports);
|
|
|
25
25
|
__exportStar(require("./getGauge"), exports);
|
|
26
26
|
__exportStar(require("./getGaugeRelativeWeight"), exports);
|
|
27
27
|
__exportStar(require("./getGaugeRelativeWeightView"), exports);
|
|
28
|
+
__exportStar(require("./getGaugeEmissions"), exports);
|
|
28
29
|
__exportStar(require("./getGaugeWeight"), exports);
|
|
29
30
|
__exportStar(require("./getLastVoteTime"), exports);
|
|
30
31
|
__exportStar(require("./getNextEpoch"), exports);
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Provider } from "ethers";
|
|
2
|
+
import { ChainId } from "../../../configs/chains";
|
|
3
|
+
export interface GaugeEpochEmission {
|
|
4
|
+
/** Epoch (Unix-week) start timestamp, seconds. */
|
|
5
|
+
epoch: number;
|
|
6
|
+
/** Reward token deposited into the distributor for this epoch (formatted). */
|
|
7
|
+
deposited: string;
|
|
8
|
+
/** Gauge relative weight at this epoch, 1e18-scaled (1e18 = 100%). */
|
|
9
|
+
relativeWeight: bigint;
|
|
10
|
+
/** Gauge relative weight as a percentage 0..100. */
|
|
11
|
+
relativeWeightPct: number;
|
|
12
|
+
/** RAAC this gauge received/was allocated for this epoch = deposited × relativeWeight. */
|
|
13
|
+
gaugeEmission: string;
|
|
14
|
+
gaugeEmissionRaw: bigint;
|
|
15
|
+
/** True for the in-progress (current) epoch — `deposited` may still grow via tick(). */
|
|
16
|
+
isCurrent: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* True for the upcoming (next) epoch preview. Nothing is deposited yet, so `deposited`
|
|
19
|
+
* is the PROJECTED system emission for that week (schedule × distributor share) and
|
|
20
|
+
* `gaugeEmission` is the projection from the gauge's weight at `nextEpoch` — i.e. what
|
|
21
|
+
* this gauge would receive if voting stays as it currently stands.
|
|
22
|
+
*/
|
|
23
|
+
isProjected?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface GaugeEmissionsResult {
|
|
26
|
+
gauge: string;
|
|
27
|
+
rewardToken: string;
|
|
28
|
+
currentEpoch: number;
|
|
29
|
+
weekSeconds: number;
|
|
30
|
+
/** Current-epoch gauge relative weight as a percentage 0..100. */
|
|
31
|
+
relativeWeightPct: number;
|
|
32
|
+
/** RAAC allocated to this gauge for the current (in-progress) epoch. */
|
|
33
|
+
currentWeekEmission: string;
|
|
34
|
+
/** Per-epoch series, oldest → newest, ending at the current epoch. */
|
|
35
|
+
epochs: GaugeEpochEmission[];
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Per-epoch emissions actually received by a gauge: the GaugeController snapshots
|
|
39
|
+
* gauge weights per epoch, and the GaugeRewardsDistributor records the RAAC deposited
|
|
40
|
+
* per epoch. A gauge's emission for an epoch is therefore
|
|
41
|
+
* depositedAtEpoch(epoch) × gaugeRelativeWeight(gauge, epoch).
|
|
42
|
+
*
|
|
43
|
+
* Returns a series ending at the current (in-progress) epoch so callers can chart
|
|
44
|
+
* "week of X → this gauge received Y RAAC".
|
|
45
|
+
*
|
|
46
|
+
* @param chainId - The chain/network to use.
|
|
47
|
+
* @param gauge - Gauge address (or config key).
|
|
48
|
+
* @param numEpochs - How many epochs to include, ending at the current one (default 8).
|
|
49
|
+
* @param provider - Optional ethers.js Provider instance.
|
|
50
|
+
*/
|
|
51
|
+
export declare const getGaugeEmissions: (chainId: ChainId, gauge: string, numEpochs?: number, includeUpcoming?: boolean, provider?: Provider) => Promise<GaugeEmissionsResult>;
|
|
@@ -8,6 +8,7 @@ export * from "./getCurrentEpoch";
|
|
|
8
8
|
export * from "./getGauge";
|
|
9
9
|
export * from "./getGaugeRelativeWeight";
|
|
10
10
|
export * from "./getGaugeRelativeWeightView";
|
|
11
|
+
export * from "./getGaugeEmissions";
|
|
11
12
|
export * from "./getGaugeWeight";
|
|
12
13
|
export * from "./getLastVoteTime";
|
|
13
14
|
export * from "./getNextEpoch";
|