Skip to content

Commit 5459ad8

Browse files
committed
feat: arm processing, daily state, redemption entity
1 parent 52f1363 commit 5459ad8

12 files changed

+462
-223
lines changed

abi/origin-lido-arm.json

+60-44
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,19 @@
4848
},
4949
{ "inputs": [], "name": "InvalidInitialization", "type": "error" },
5050
{ "inputs": [], "name": "NotInitializing", "type": "error" },
51+
{
52+
"inputs": [
53+
{ "internalType": "uint8", "name": "bits", "type": "uint8" },
54+
{ "internalType": "int256", "name": "value", "type": "int256" }
55+
],
56+
"name": "SafeCastOverflowedIntDowncast",
57+
"type": "error"
58+
},
59+
{
60+
"inputs": [{ "internalType": "int256", "name": "value", "type": "int256" }],
61+
"name": "SafeCastOverflowedIntToUint",
62+
"type": "error"
63+
},
5164
{
5265
"inputs": [
5366
{ "internalType": "uint8", "name": "bits", "type": "uint8" },
@@ -56,6 +69,11 @@
5669
"name": "SafeCastOverflowedUintDowncast",
5770
"type": "error"
5871
},
72+
{
73+
"inputs": [{ "internalType": "uint256", "name": "value", "type": "uint256" }],
74+
"name": "SafeCastOverflowedUintToInt",
75+
"type": "error"
76+
},
5977
{
6078
"anonymous": false,
6179
"inputs": [
@@ -75,13 +93,20 @@
7593
"name": "Approval",
7694
"type": "event"
7795
},
96+
{
97+
"anonymous": false,
98+
"inputs": [{ "indexed": true, "internalType": "address", "name": "capManager", "type": "address" }],
99+
"name": "CapManagerUpdated",
100+
"type": "event"
101+
},
78102
{
79103
"anonymous": false,
80104
"inputs": [
81-
{ "indexed": false, "internalType": "uint256", "name": "newFeesAccrued", "type": "uint256" },
82-
{ "indexed": false, "internalType": "uint256", "name": "assetIncrease", "type": "uint256" }
105+
{ "indexed": true, "internalType": "address", "name": "owner", "type": "address" },
106+
{ "indexed": false, "internalType": "uint256", "name": "assets", "type": "uint256" },
107+
{ "indexed": false, "internalType": "uint256", "name": "shares", "type": "uint256" }
83108
],
84-
"name": "FeeCalculated",
109+
"name": "Deposit",
85110
"type": "event"
86111
},
87112
{
@@ -111,14 +136,6 @@
111136
"name": "Initialized",
112137
"type": "event"
113138
},
114-
{
115-
"anonymous": false,
116-
"inputs": [
117-
{ "indexed": true, "internalType": "address", "name": "liquidityProviderController", "type": "address" }
118-
],
119-
"name": "LiquidityProviderControllerUpdated",
120-
"type": "event"
121-
},
122139
{
123140
"anonymous": false,
124141
"inputs": [{ "indexed": false, "internalType": "address", "name": "newAdmin", "type": "address" }],
@@ -214,14 +231,20 @@
214231
"stateMutability": "nonpayable",
215232
"type": "function"
216233
},
217-
{ "inputs": [], "name": "approveStETH", "outputs": [], "stateMutability": "nonpayable", "type": "function" },
218234
{
219235
"inputs": [{ "internalType": "address", "name": "account", "type": "address" }],
220236
"name": "balanceOf",
221237
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
222238
"stateMutability": "view",
223239
"type": "function"
224240
},
241+
{
242+
"inputs": [],
243+
"name": "capManager",
244+
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
245+
"stateMutability": "view",
246+
"type": "function"
247+
},
225248
{
226249
"inputs": [{ "internalType": "uint256", "name": "requestId", "type": "uint256" }],
227250
"name": "claimRedeem",
@@ -236,6 +259,13 @@
236259
"stateMutability": "nonpayable",
237260
"type": "function"
238261
},
262+
{
263+
"inputs": [],
264+
"name": "claimable",
265+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
266+
"stateMutability": "view",
267+
"type": "function"
268+
},
239269
{
240270
"inputs": [],
241271
"name": "collectFees",
@@ -288,7 +318,7 @@
288318
{
289319
"inputs": [],
290320
"name": "feesAccrued",
291-
"outputs": [{ "internalType": "uint112", "name": "", "type": "uint112" }],
321+
"outputs": [{ "internalType": "uint256", "name": "fees", "type": "uint256" }],
292322
"stateMutability": "view",
293323
"type": "function"
294324
},
@@ -299,7 +329,7 @@
299329
{ "internalType": "address", "name": "_operator", "type": "address" },
300330
{ "internalType": "uint256", "name": "_fee", "type": "uint256" },
301331
{ "internalType": "address", "name": "_feeCollector", "type": "address" },
302-
{ "internalType": "address", "name": "_liquidityProviderController", "type": "address" }
332+
{ "internalType": "address", "name": "_capManager", "type": "address" }
303333
],
304334
"name": "initialize",
305335
"outputs": [],
@@ -308,21 +338,21 @@
308338
},
309339
{
310340
"inputs": [],
311-
"name": "lastTotalAssets",
312-
"outputs": [{ "internalType": "uint128", "name": "", "type": "uint128" }],
341+
"name": "lastAvailableAssets",
342+
"outputs": [{ "internalType": "int128", "name": "", "type": "int128" }],
313343
"stateMutability": "view",
314344
"type": "function"
315345
},
316346
{
317347
"inputs": [],
318-
"name": "liquidityAsset",
319-
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
348+
"name": "lidoWithdrawalQueueAmount",
349+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
320350
"stateMutability": "view",
321351
"type": "function"
322352
},
323353
{
324354
"inputs": [],
325-
"name": "liquidityProviderController",
355+
"name": "liquidityAsset",
326356
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
327357
"stateMutability": "view",
328358
"type": "function"
@@ -337,7 +367,7 @@
337367
{
338368
"inputs": [],
339369
"name": "nextWithdrawalIndex",
340-
"outputs": [{ "internalType": "uint128", "name": "", "type": "uint128" }],
370+
"outputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }],
341371
"stateMutability": "view",
342372
"type": "function"
343373
},
@@ -348,13 +378,6 @@
348378
"stateMutability": "view",
349379
"type": "function"
350380
},
351-
{
352-
"inputs": [],
353-
"name": "outstandingEther",
354-
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
355-
"stateMutability": "view",
356-
"type": "function"
357-
},
358381
{
359382
"inputs": [],
360383
"name": "owner",
@@ -394,22 +417,22 @@
394417
"type": "function"
395418
},
396419
{
397-
"inputs": [{ "internalType": "uint256", "name": "_fee", "type": "uint256" }],
398-
"name": "setFee",
420+
"inputs": [{ "internalType": "address", "name": "_capManager", "type": "address" }],
421+
"name": "setCapManager",
399422
"outputs": [],
400423
"stateMutability": "nonpayable",
401424
"type": "function"
402425
},
403426
{
404-
"inputs": [{ "internalType": "address", "name": "_feeCollector", "type": "address" }],
405-
"name": "setFeeCollector",
427+
"inputs": [{ "internalType": "uint256", "name": "_fee", "type": "uint256" }],
428+
"name": "setFee",
406429
"outputs": [],
407430
"stateMutability": "nonpayable",
408431
"type": "function"
409432
},
410433
{
411-
"inputs": [{ "internalType": "address", "name": "_liquidityProviderController", "type": "address" }],
412-
"name": "setLiquidityProviderController",
434+
"inputs": [{ "internalType": "address", "name": "_feeCollector", "type": "address" }],
435+
"name": "setFeeCollector",
413436
"outputs": [],
414437
"stateMutability": "nonpayable",
415438
"type": "function"
@@ -588,30 +611,23 @@
588611
{ "internalType": "address", "name": "withdrawer", "type": "address" },
589612
{ "internalType": "bool", "name": "claimed", "type": "bool" },
590613
{ "internalType": "uint40", "name": "claimTimestamp", "type": "uint40" },
591-
{ "internalType": "uint128", "name": "assets", "type": "uint128" },
592-
{ "internalType": "uint128", "name": "queued", "type": "uint128" }
614+
{ "internalType": "uint120", "name": "assets", "type": "uint120" },
615+
{ "internalType": "uint120", "name": "queued", "type": "uint120" }
593616
],
594617
"stateMutability": "view",
595618
"type": "function"
596619
},
597-
{
598-
"inputs": [],
599-
"name": "withdrawsClaimable",
600-
"outputs": [{ "internalType": "uint128", "name": "", "type": "uint128" }],
601-
"stateMutability": "view",
602-
"type": "function"
603-
},
604620
{
605621
"inputs": [],
606622
"name": "withdrawsClaimed",
607-
"outputs": [{ "internalType": "uint128", "name": "", "type": "uint128" }],
623+
"outputs": [{ "internalType": "uint120", "name": "", "type": "uint120" }],
608624
"stateMutability": "view",
609625
"type": "function"
610626
},
611627
{
612628
"inputs": [],
613629
"name": "withdrawsQueued",
614-
"outputs": [{ "internalType": "uint128", "name": "", "type": "uint128" }],
630+
"outputs": [{ "internalType": "uint120", "name": "", "type": "uint120" }],
615631
"stateMutability": "view",
616632
"type": "function"
617633
},

db/migrations/1727834322947-Data.js renamed to db/migrations/1728077140339-Data.js

+27-15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

schema.graphql

+25-3
Original file line numberDiff line numberDiff line change
@@ -782,20 +782,42 @@ type ArmState @entity {
782782
assets1: BigInt!
783783
outstandingAssets1: BigInt!
784784
totalAssets: BigInt!
785+
totalAssetsCap: BigInt!
785786
totalSupply: BigInt!
787+
redemptionRate: BigInt!
788+
fees: BigInt!
789+
}
790+
791+
type ArmDailyState @entity {
792+
id: ID!
793+
chainId: Int! @index
794+
timestamp: DateTime! @index
795+
blockNumber: Int! @index
796+
address: String! @index
797+
assets0: BigInt!
798+
assets1: BigInt!
799+
outstandingAssets1: BigInt!
800+
totalAssets: BigInt!
801+
totalAssetsCap: BigInt!
802+
totalSupply: BigInt!
803+
redemptionRate: BigInt!
786804
apr: Float!
787-
yield: BigInt!
805+
apy: Float!
788806
fees: BigInt!
789807
}
790808

791-
type ArmWalletState @entity {
809+
type ArmRedemption @entity {
792810
id: ID!
793811
chainId: Int! @index
812+
txHash: String! @index
794813
timestamp: DateTime! @index
795814
blockNumber: Int! @index
796815
address: String! @index
797816
account: String! @index
798-
balance: BigInt!
817+
requestId: BigInt!
818+
amount: BigInt!
819+
queued: BigInt!
820+
claimed: Boolean!
799821
}
800822
# State
801823

schema/arm.graphql

+13-5
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,28 @@ type ArmState @entity {
3333
assets1: BigInt!
3434
outstandingAssets1: BigInt!
3535
totalAssets: BigInt!
36+
totalAssetsCap: BigInt!
3637
totalSupply: BigInt!
37-
apr: Float!
38-
yield: BigInt!
38+
redemptionRate: BigInt!
3939
fees: BigInt!
4040
}
4141

42-
type ArmWalletState @entity {
42+
type ArmDailyState @entity {
4343
id: ID!
4444
chainId: Int! @index
4545
timestamp: DateTime! @index
4646
blockNumber: Int! @index
4747
address: String! @index
48-
account: String! @index
49-
balance: BigInt!
48+
assets0: BigInt!
49+
assets1: BigInt!
50+
outstandingAssets1: BigInt!
51+
totalAssets: BigInt!
52+
totalAssetsCap: BigInt!
53+
totalSupply: BigInt!
54+
redemptionRate: BigInt!
55+
apr: Float!
56+
apy: Float!
57+
fees: BigInt!
5058
}
5159

5260
type ArmRedemption @entity {

0 commit comments

Comments
 (0)