Skip to content

Commit 1c63a63

Browse files
authored
Subgraph & app: adapt to new deployment (#900)
* Update app ABIs * Subgraph queries: log errors in the console * Subgraph: update networks * Subgraph: remove unused / obsoleted entities * Subgraph: upgrade dependencies
1 parent 6144764 commit 1c63a63

16 files changed

+1029
-1988
lines changed

frontend/app/src/abi/BorrowerOperations.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ export const BorrowerOperations = [
66
"inputs": [{ "name": "_addressesRegistry", "type": "address", "internalType": "contract IAddressesRegistry" }],
77
"stateMutability": "nonpayable",
88
},
9+
{
10+
"type": "function",
11+
"name": "BCR",
12+
"inputs": [],
13+
"outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }],
14+
"stateMutability": "view",
15+
},
916
{
1017
"type": "function",
1118
"name": "CCR",
@@ -182,6 +189,17 @@ export const BorrowerOperations = [
182189
"outputs": [{ "name": "", "type": "address", "internalType": "address" }],
183190
"stateMutability": "view",
184191
},
192+
{
193+
"type": "function",
194+
"name": "kickFromBatch",
195+
"inputs": [{ "name": "_troveId", "type": "uint256", "internalType": "uint256" }, {
196+
"name": "_upperHint",
197+
"type": "uint256",
198+
"internalType": "uint256",
199+
}, { "name": "_lowerHint", "type": "uint256", "internalType": "uint256" }],
200+
"outputs": [],
201+
"stateMutability": "nonpayable",
202+
},
185203
{
186204
"type": "function",
187205
"name": "lowerBatchManagementFee",
@@ -500,13 +518,15 @@ export const BorrowerOperations = [
500518
{ "type": "error", "name": "BatchInterestRateChangePeriodNotPassed", "inputs": [] },
501519
{ "type": "error", "name": "BatchManagerExists", "inputs": [] },
502520
{ "type": "error", "name": "BatchManagerNotNew", "inputs": [] },
521+
{ "type": "error", "name": "BatchSharesRatioTooLow", "inputs": [] },
503522
{ "type": "error", "name": "CallerNotPriceFeed", "inputs": [] },
504523
{ "type": "error", "name": "CallerNotTroveManager", "inputs": [] },
505524
{ "type": "error", "name": "CollWithdrawalTooHigh", "inputs": [] },
506525
{ "type": "error", "name": "DebtBelowMin", "inputs": [] },
507526
{ "type": "error", "name": "DelegateInterestRateChangePeriodNotPassed", "inputs": [] },
508527
{ "type": "error", "name": "EmptyManager", "inputs": [] },
509528
{ "type": "error", "name": "ICRBelowMCR", "inputs": [] },
529+
{ "type": "error", "name": "ICRBelowMCRPlusBCR", "inputs": [] },
510530
{ "type": "error", "name": "InterestNotInRange", "inputs": [] },
511531
{ "type": "error", "name": "InterestRateNotNew", "inputs": [] },
512532
{ "type": "error", "name": "InterestRateTooHigh", "inputs": [] },

frontend/app/src/abi/LeverageLSTZapper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ export const LeverageLSTZapper = [
262262
{
263263
"type": "function",
264264
"name": "receiveFlashLoanOnOpenLeveragedTrove",
265-
"inputs": [{
265+
"inputs": [{ "name": "_originalSender", "type": "address", "internalType": "address" }, {
266266
"name": "_params",
267267
"type": "tuple",
268268
"internalType": "struct ILeverageZapper.OpenLeveragedTroveParams",

frontend/app/src/abi/LeverageWETHZapper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ export const LeverageWETHZapper = [
251251
{
252252
"type": "function",
253253
"name": "receiveFlashLoanOnOpenLeveragedTrove",
254-
"inputs": [{
254+
"inputs": [{ "name": "_originalSender", "type": "address", "internalType": "address" }, {
255255
"name": "_params",
256256
"type": "tuple",
257257
"internalType": "struct ILeverageZapper.OpenLeveragedTroveParams",

frontend/app/src/abi/MultiTroveGetter.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,19 @@ export const MultiTroveGetter = [{
4343
"internalType": "struct IMultiTroveGetter.CombinedTroveData[]",
4444
"components": [
4545
{ "name": "id", "type": "uint256", "internalType": "uint256" },
46-
{ "name": "debt", "type": "uint256", "internalType": "uint256" },
47-
{ "name": "coll", "type": "uint256", "internalType": "uint256" },
48-
{ "name": "stake", "type": "uint256", "internalType": "uint256" },
46+
{ "name": "entireDebt", "type": "uint256", "internalType": "uint256" },
47+
{ "name": "entireColl", "type": "uint256", "internalType": "uint256" },
48+
{ "name": "redistBoldDebtGain", "type": "uint256", "internalType": "uint256" },
49+
{ "name": "redistCollGain", "type": "uint256", "internalType": "uint256" },
50+
{ "name": "accruedInterest", "type": "uint256", "internalType": "uint256" },
51+
{ "name": "recordedDebt", "type": "uint256", "internalType": "uint256" },
4952
{ "name": "annualInterestRate", "type": "uint256", "internalType": "uint256" },
50-
{ "name": "lastDebtUpdateTime", "type": "uint256", "internalType": "uint256" },
53+
{ "name": "accruedBatchManagementFee", "type": "uint256", "internalType": "uint256" },
5154
{ "name": "lastInterestRateAdjTime", "type": "uint256", "internalType": "uint256" },
55+
{ "name": "stake", "type": "uint256", "internalType": "uint256" },
56+
{ "name": "lastDebtUpdateTime", "type": "uint256", "internalType": "uint256" },
5257
{ "name": "interestBatchManager", "type": "address", "internalType": "address" },
5358
{ "name": "batchDebtShares", "type": "uint256", "internalType": "uint256" },
54-
{ "name": "batchCollShares", "type": "uint256", "internalType": "uint256" },
5559
{ "name": "snapshotETH", "type": "uint256", "internalType": "uint256" },
5660
{ "name": "snapshotBoldDebt", "type": "uint256", "internalType": "uint256" },
5761
],

frontend/app/src/abi/PriceFeed.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const PriceFeed = [{
99
"type": "bool",
1010
"internalType": "bool",
1111
}],
12-
"stateMutability": "nonpayable",
12+
"stateMutability": "view",
1313
}, {
1414
"type": "function",
1515
"name": "fetchRedemptionPrice",
@@ -19,12 +19,18 @@ export const PriceFeed = [{
1919
"type": "bool",
2020
"internalType": "bool",
2121
}],
22-
"stateMutability": "nonpayable",
22+
"stateMutability": "view",
2323
}, {
2424
"type": "function",
25-
"name": "getPrice",
25+
"name": "getEthUsdStalenessThreshold",
2626
"inputs": [],
2727
"outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }],
28+
"stateMutability": "pure",
29+
}, {
30+
"type": "function",
31+
"name": "getPrice",
32+
"inputs": [],
33+
"outputs": [{ "name": "_price", "type": "uint256", "internalType": "uint256" }],
2834
"stateMutability": "view",
2935
}, {
3036
"type": "function",
@@ -41,12 +47,7 @@ export const PriceFeed = [{
4147
}, {
4248
"type": "function",
4349
"name": "setPrice",
44-
"inputs": [{ "name": "price", "type": "uint256", "internalType": "uint256" }],
45-
"outputs": [{ "name": "", "type": "bool", "internalType": "bool" }],
50+
"inputs": [{ "name": "_price", "type": "uint256", "internalType": "uint256" }],
51+
"outputs": [],
4652
"stateMutability": "nonpayable",
47-
}, {
48-
"type": "event",
49-
"name": "LastGoodPriceUpdated",
50-
"inputs": [{ "name": "_lastGoodPrice", "type": "uint256", "indexed": false, "internalType": "uint256" }],
51-
"anonymous": false,
5253
}] as const;

frontend/app/src/abi/StabilityPool.ts

Lines changed: 48 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ export const StabilityPool = [
66
"inputs": [{ "name": "_addressesRegistry", "type": "address", "internalType": "contract IAddressesRegistry" }],
77
"stateMutability": "nonpayable",
88
},
9+
{
10+
"type": "function",
11+
"name": "MAX_SCALE_FACTOR_EXPONENT",
12+
"inputs": [],
13+
"outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }],
14+
"stateMutability": "view",
15+
},
916
{
1017
"type": "function",
1118
"name": "NAME",
@@ -20,13 +27,27 @@ export const StabilityPool = [
2027
"outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }],
2128
"stateMutability": "view",
2229
},
30+
{
31+
"type": "function",
32+
"name": "P_PRECISION",
33+
"inputs": [],
34+
"outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }],
35+
"stateMutability": "view",
36+
},
2337
{
2438
"type": "function",
2539
"name": "SCALE_FACTOR",
2640
"inputs": [],
2741
"outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }],
2842
"stateMutability": "view",
2943
},
44+
{
45+
"type": "function",
46+
"name": "SCALE_SPAN",
47+
"inputs": [],
48+
"outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }],
49+
"stateMutability": "view",
50+
},
3051
{
3152
"type": "function",
3253
"name": "activePool",
@@ -49,18 +70,11 @@ export const StabilityPool = [
4970
"outputs": [{ "name": "", "type": "address", "internalType": "contract IERC20" }],
5071
"stateMutability": "view",
5172
},
52-
{
53-
"type": "function",
54-
"name": "currentEpoch",
55-
"inputs": [],
56-
"outputs": [{ "name": "", "type": "uint128", "internalType": "uint128" }],
57-
"stateMutability": "view",
58-
},
5973
{
6074
"type": "function",
6175
"name": "currentScale",
6276
"inputs": [],
63-
"outputs": [{ "name": "", "type": "uint128", "internalType": "uint128" }],
77+
"outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }],
6478
"stateMutability": "view",
6579
},
6680
{
@@ -71,8 +85,7 @@ export const StabilityPool = [
7185
{ "name": "S", "type": "uint256", "internalType": "uint256" },
7286
{ "name": "P", "type": "uint256", "internalType": "uint256" },
7387
{ "name": "B", "type": "uint256", "internalType": "uint256" },
74-
{ "name": "scale", "type": "uint128", "internalType": "uint128" },
75-
{ "name": "epoch", "type": "uint128", "internalType": "uint128" },
88+
{ "name": "scale", "type": "uint256", "internalType": "uint256" },
7689
],
7790
"stateMutability": "view",
7891
},
@@ -83,28 +96,6 @@ export const StabilityPool = [
8396
"outputs": [{ "name": "initialValue", "type": "uint256", "internalType": "uint256" }],
8497
"stateMutability": "view",
8598
},
86-
{
87-
"type": "function",
88-
"name": "epochToScaleToB",
89-
"inputs": [{ "name": "", "type": "uint128", "internalType": "uint128" }, {
90-
"name": "",
91-
"type": "uint128",
92-
"internalType": "uint128",
93-
}],
94-
"outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }],
95-
"stateMutability": "view",
96-
},
97-
{
98-
"type": "function",
99-
"name": "epochToScaleToS",
100-
"inputs": [{ "name": "", "type": "uint128", "internalType": "uint128" }, {
101-
"name": "",
102-
"type": "uint128",
103-
"internalType": "uint128",
104-
}],
105-
"outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }],
106-
"stateMutability": "view",
107-
},
10899
{
109100
"type": "function",
110101
"name": "getCollBalance",
@@ -116,7 +107,7 @@ export const StabilityPool = [
116107
"type": "function",
117108
"name": "getCompoundedBoldDeposit",
118109
"inputs": [{ "name": "_depositor", "type": "address", "internalType": "address" }],
119-
"outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }],
110+
"outputs": [{ "name": "compoundedDeposit", "type": "uint256", "internalType": "uint256" }],
120111
"stateMutability": "view",
121112
},
122113
{
@@ -175,34 +166,6 @@ export const StabilityPool = [
175166
"outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }],
176167
"stateMutability": "view",
177168
},
178-
{
179-
"type": "function",
180-
"name": "lastBoldLossErrorByP_Offset",
181-
"inputs": [],
182-
"outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }],
183-
"stateMutability": "view",
184-
},
185-
{
186-
"type": "function",
187-
"name": "lastBoldLossError_TotalDeposits",
188-
"inputs": [],
189-
"outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }],
190-
"stateMutability": "view",
191-
},
192-
{
193-
"type": "function",
194-
"name": "lastCollError_Offset",
195-
"inputs": [],
196-
"outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }],
197-
"stateMutability": "view",
198-
},
199-
{
200-
"type": "function",
201-
"name": "lastYieldError",
202-
"inputs": [],
203-
"outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }],
204-
"stateMutability": "view",
205-
},
206169
{
207170
"type": "function",
208171
"name": "offset",
@@ -225,6 +188,20 @@ export const StabilityPool = [
225188
"outputs": [],
226189
"stateMutability": "nonpayable",
227190
},
191+
{
192+
"type": "function",
193+
"name": "scaleToB",
194+
"inputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }],
195+
"outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }],
196+
"stateMutability": "view",
197+
},
198+
{
199+
"type": "function",
200+
"name": "scaleToS",
201+
"inputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }],
202+
"outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }],
203+
"stateMutability": "view",
204+
},
228205
{
229206
"type": "function",
230207
"name": "stashedColl",
@@ -267,11 +244,11 @@ export const StabilityPool = [
267244
"type": "event",
268245
"name": "B_Updated",
269246
"inputs": [{ "name": "_B", "type": "uint256", "indexed": false, "internalType": "uint256" }, {
270-
"name": "_epoch",
271-
"type": "uint128",
247+
"name": "_scale",
248+
"type": "uint256",
272249
"indexed": false,
273-
"internalType": "uint128",
274-
}, { "name": "_scale", "type": "uint128", "indexed": false, "internalType": "uint128" }],
250+
"internalType": "uint256",
251+
}],
275252
"anonymous": false,
276253
},
277254
{
@@ -298,7 +275,7 @@ export const StabilityPool = [
298275
"internalType": "enum IStabilityPoolEvents.Operation",
299276
},
300277
{ "name": "_depositLossSinceLastOperation", "type": "uint256", "indexed": false, "internalType": "uint256" },
301-
{ "name": "_depositChange", "type": "int256", "indexed": false, "internalType": "int256" },
278+
{ "name": "_topUpOrWithdrawal", "type": "int256", "indexed": false, "internalType": "int256" },
302279
{ "name": "_yieldGainSinceLastOperation", "type": "uint256", "indexed": false, "internalType": "uint256" },
303280
{ "name": "_yieldGainClaimed", "type": "uint256", "indexed": false, "internalType": "uint256" },
304281
{ "name": "_ethGainSinceLastOperation", "type": "uint256", "indexed": false, "internalType": "uint256" },
@@ -317,16 +294,9 @@ export const StabilityPool = [
317294
{ "name": "_snapshotS", "type": "uint256", "indexed": false, "internalType": "uint256" },
318295
{ "name": "_snapshotB", "type": "uint256", "indexed": false, "internalType": "uint256" },
319296
{ "name": "_snapshotScale", "type": "uint256", "indexed": false, "internalType": "uint256" },
320-
{ "name": "_snapshotEpoch", "type": "uint256", "indexed": false, "internalType": "uint256" },
321297
],
322298
"anonymous": false,
323299
},
324-
{
325-
"type": "event",
326-
"name": "EpochUpdated",
327-
"inputs": [{ "name": "_currentEpoch", "type": "uint128", "indexed": false, "internalType": "uint128" }],
328-
"anonymous": false,
329-
},
330300
{
331301
"type": "event",
332302
"name": "P_Updated",
@@ -343,17 +313,17 @@ export const StabilityPool = [
343313
"type": "event",
344314
"name": "S_Updated",
345315
"inputs": [{ "name": "_S", "type": "uint256", "indexed": false, "internalType": "uint256" }, {
346-
"name": "_epoch",
347-
"type": "uint128",
316+
"name": "_scale",
317+
"type": "uint256",
348318
"indexed": false,
349-
"internalType": "uint128",
350-
}, { "name": "_scale", "type": "uint128", "indexed": false, "internalType": "uint128" }],
319+
"internalType": "uint256",
320+
}],
351321
"anonymous": false,
352322
},
353323
{
354324
"type": "event",
355325
"name": "ScaleUpdated",
356-
"inputs": [{ "name": "_currentScale", "type": "uint128", "indexed": false, "internalType": "uint128" }],
326+
"inputs": [{ "name": "_currentScale", "type": "uint256", "indexed": false, "internalType": "uint256" }],
357327
"anonymous": false,
358328
},
359329
{

frontend/app/src/abi/TroveManager.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ export const TroveManager = [
9393
"type": "tuple",
9494
"internalType": "struct LatestBatchData",
9595
"components": [
96+
{ "name": "totalDebtShares", "type": "uint256", "internalType": "uint256" },
9697
{ "name": "entireDebtWithoutRedistribution", "type": "uint256", "internalType": "uint256" },
9798
{ "name": "entireCollWithoutRedistribution", "type": "uint256", "internalType": "uint256" },
9899
{ "name": "accruedInterest", "type": "uint256", "internalType": "uint256" },
@@ -514,7 +515,7 @@ export const TroveManager = [
514515
{ "name": "_redemptionRate", "type": "uint256", "internalType": "uint256" },
515516
{ "name": "_maxIterations", "type": "uint256", "internalType": "uint256" },
516517
],
517-
"outputs": [{ "name": "_redemeedAmount", "type": "uint256", "internalType": "uint256" }],
518+
"outputs": [{ "name": "_redeemedAmount", "type": "uint256", "internalType": "uint256" }],
518519
"stateMutability": "nonpayable",
519520
},
520521
{
@@ -688,6 +689,7 @@ export const TroveManager = [
688689
{ "name": "_ETHSent", "type": "uint256", "indexed": false, "internalType": "uint256" },
689690
{ "name": "_ETHFee", "type": "uint256", "indexed": false, "internalType": "uint256" },
690691
{ "name": "_price", "type": "uint256", "indexed": false, "internalType": "uint256" },
692+
{ "name": "_redemptionPrice", "type": "uint256", "indexed": false, "internalType": "uint256" },
691693
],
692694
"anonymous": false,
693695
},

frontend/app/src/subgraph.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ async function graphQuery<TResult, TVariables>(
2929
const result = await response.json();
3030

3131
if (!result.data) {
32+
console.error(result);
3233
throw new Error("Invalid response from the subgraph");
3334
}
3435

0 commit comments

Comments
 (0)