Skip to content

Commit c701495

Browse files
committed
add superoethb withdrawals
1 parent fc9c5a9 commit c701495

File tree

17 files changed

+309
-678
lines changed

17 files changed

+309
-678
lines changed

abi/otoken.json

Lines changed: 78 additions & 470 deletions
Large diffs are not rendered by default.

db/migrations/1729704740947-Data.js renamed to db/migrations/1729880820715-Data.js

Lines changed: 24 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

schema.graphql

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1568,28 +1568,6 @@ type OETHCollateralDailyStat @entity {
15681568
price: BigInt!
15691569
value: BigInt!
15701570
}
1571-
1572-
type OETHRewardTokenCollected @entity {
1573-
id: ID!
1574-
timestamp: DateTime! @index
1575-
blockNumber: Int! @index
1576-
strategy: String!
1577-
recipient: String!
1578-
rewardToken: String!
1579-
amount: BigInt!
1580-
}
1581-
1582-
type OETHWithdrawalRequest @entity {
1583-
id: ID!
1584-
timestamp: DateTime! @index
1585-
blockNumber: Int! @index
1586-
requestId: BigInt!
1587-
withdrawer: String!
1588-
amount: BigInt!
1589-
queued: BigInt!
1590-
claimed: Boolean!
1591-
txHash: String! @index
1592-
}
15931571
type OGNDailyStat @entity {
15941572
id: ID!
15951573
blockNumber: Int! @index
@@ -1911,6 +1889,32 @@ type OTokenHarvesterYieldSent @entity {
19111889
yield: BigInt!
19121890
fee: BigInt!
19131891
}
1892+
1893+
type OTokenRewardTokenCollected @entity {
1894+
id: ID!
1895+
chainId: Int! @index
1896+
blockNumber: Int! @index
1897+
timestamp: DateTime! @index
1898+
otoken: String! @index
1899+
strategy: String!
1900+
recipient: String!
1901+
rewardToken: String!
1902+
amount: BigInt!
1903+
}
1904+
1905+
type OTokenWithdrawalRequest @entity {
1906+
id: ID!
1907+
chainId: Int! @index
1908+
blockNumber: Int! @index
1909+
timestamp: DateTime! @index
1910+
otoken: String! @index
1911+
requestId: BigInt!
1912+
withdrawer: String!
1913+
amount: BigInt!
1914+
queued: BigInt!
1915+
claimed: Boolean!
1916+
txHash: String! @index
1917+
}
19141918
"""
19151919
The Vault entity tracks the OUSD vault balance over time.
19161920
"""

schema/oeth.graphql

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -160,25 +160,3 @@ type OETHCollateralDailyStat @entity {
160160
price: BigInt!
161161
value: BigInt!
162162
}
163-
164-
type OETHRewardTokenCollected @entity {
165-
id: ID!
166-
timestamp: DateTime! @index
167-
blockNumber: Int! @index
168-
strategy: String!
169-
recipient: String!
170-
rewardToken: String!
171-
amount: BigInt!
172-
}
173-
174-
type OETHWithdrawalRequest @entity {
175-
id: ID!
176-
timestamp: DateTime! @index
177-
blockNumber: Int! @index
178-
requestId: BigInt!
179-
withdrawer: String!
180-
amount: BigInt!
181-
queued: BigInt!
182-
claimed: Boolean!
183-
txHash: String! @index
184-
}

schema/otoken.graphql

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,3 +188,29 @@ type OTokenHarvesterYieldSent @entity {
188188
yield: BigInt!
189189
fee: BigInt!
190190
}
191+
192+
type OTokenRewardTokenCollected @entity {
193+
id: ID!
194+
chainId: Int! @index
195+
blockNumber: Int! @index
196+
timestamp: DateTime! @index
197+
otoken: String! @index
198+
strategy: String!
199+
recipient: String!
200+
rewardToken: String!
201+
amount: BigInt!
202+
}
203+
204+
type OTokenWithdrawalRequest @entity {
205+
id: ID!
206+
chainId: Int! @index
207+
blockNumber: Int! @index
208+
timestamp: DateTime! @index
209+
otoken: String! @index
210+
requestId: BigInt!
211+
withdrawer: String!
212+
amount: BigInt!
213+
queued: BigInt!
214+
claimed: Boolean!
215+
txHash: String! @index
216+
}

src/abi/otoken.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export const functions = {
2828
governor: viewFun("0x0c340a24", "governor()", {}, p.address),
2929
increaseAllowance: fun("0x39509351", "increaseAllowance(address,uint256)", {"_spender": p.address, "_addedValue": p.uint256}, p.bool),
3030
initialize: fun("0xf542033f", "initialize(string,string,address,uint256)", {"_nameArg": p.string, "_symbolArg": p.string, "_vaultAddress": p.address, "_initialCreditsPerToken": p.uint256}, ),
31+
initialize2: fun("0x472abf68", "initialize2()", {}, ),
3132
isGovernor: viewFun("0xc7af3352", "isGovernor()", {}, p.bool),
3233
isUpgraded: viewFun("0x95ef84b9", "isUpgraded(address)", {"_0": p.address}, p.uint256),
3334
mint: fun("0x40c10f19", "mint(address,uint256)", {"_account": p.address, "_amount": p.uint256}, ),
@@ -187,6 +188,9 @@ export type IncreaseAllowanceReturn = FunctionReturn<typeof functions.increaseAl
187188
export type InitializeParams = FunctionArguments<typeof functions.initialize>
188189
export type InitializeReturn = FunctionReturn<typeof functions.initialize>
189190

191+
export type Initialize2Params = FunctionArguments<typeof functions.initialize2>
192+
export type Initialize2Return = FunctionReturn<typeof functions.initialize2>
193+
190194
export type IsGovernorParams = FunctionArguments<typeof functions.isGovernor>
191195
export type IsGovernorReturn = FunctionReturn<typeof functions.isGovernor>
192196

src/base/strategies.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { OETHRewardTokenCollected } from '@model'
21
import { Context } from '@processor'
32
import { EvmBatchProcessor } from '@subsquid/evm-processor'
43
import { IStrategyData, createStrategyProcessor, createStrategySetup } from '@templates/strategy'
@@ -36,14 +35,7 @@ const strategies = oethbStrategies
3635

3736
const processors = [
3837
...strategies.map(createStrategyProcessor),
39-
...strategies
40-
.filter((s) => s.kind !== 'Vault')
41-
.map((strategy) =>
42-
createStrategyRewardProcessor({
43-
...strategy,
44-
OTokenRewardTokenCollected: OETHRewardTokenCollected,
45-
}),
46-
),
38+
...strategies.filter((s) => s.kind !== 'Vault').map((strategy) => createStrategyRewardProcessor(strategy)),
4739
]
4840

4941
export const baseStrategies = {

src/base/super-oeth-b.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { EvmBatchProcessor } from '@subsquid/evm-processor'
55
import { getPositions } from '@templates/aerodrome/lp'
66
import { createOTokenProcessor } from '@templates/otoken'
77
import { createOTokenActivityProcessor } from '@templates/otoken/activity-processor/activity-processor'
8+
import { createOTokenWithdrawalsProcessor } from '@templates/withdrawals'
89
import { aerodromePools, baseAddresses } from '@utils/addresses-base'
910

1011
const otokenProcessor = createOTokenProcessor({
@@ -55,13 +56,23 @@ const otokenActivityProcessor = createOTokenActivityProcessor({
5556
cowSwap: false,
5657
})
5758

59+
const otokenWithdrawalsProcessor = createOTokenWithdrawalsProcessor({
60+
oTokenAddress: baseAddresses.superOETHb.address,
61+
from: 21544908,
62+
})
63+
5864
export const superOETHb = {
5965
from: Math.min(otokenProcessor.from, otokenActivityProcessor.from),
6066
setup: (processor: EvmBatchProcessor) => {
6167
otokenProcessor.setup(processor)
6268
otokenActivityProcessor.setup(processor)
69+
otokenWithdrawalsProcessor.setup(processor)
6370
},
6471
process: async (ctx: Context) => {
65-
await Promise.all([otokenProcessor.process(ctx), otokenActivityProcessor.process(ctx)])
72+
await Promise.all([
73+
otokenProcessor.process(ctx),
74+
otokenActivityProcessor.process(ctx),
75+
otokenWithdrawalsProcessor.process(ctx),
76+
])
6677
},
6778
}

src/main-oeth.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import 'tsconfig-paths/register'
33
import { run } from '@processor'
44
import * as exchangeRatesPostProcessor from '@shared/post-processors/exchange-rates'
55
import { processStatus } from '@templates/processor-status'
6+
import { addresses } from '@utils/addresses'
67

78
import * as dailyStats from './oeth/post-processors/daily-stats'
89
import * as oeth from './oeth/processors'
@@ -15,8 +16,8 @@ import * as fraxStaking from './oeth/processors/frax-staking'
1516
import * as morphoAave from './oeth/processors/morpho-aave'
1617
import * as strategies from './oeth/processors/strategies'
1718
import * as vault from './oeth/processors/vault'
18-
import * as withdrawals from './oeth/processors/withdrawals'
1919
import * as validateOeth from './oeth/validators/validate-oeth'
20+
import { createOTokenWithdrawalsProcessor } from './templates/withdrawals'
2021

2122
export const processor = {
2223
stateSchema: 'oeth-processor',
@@ -31,7 +32,7 @@ export const processor = {
3132
balancerMetaPoolStrategy,
3233
strategies,
3334
exchangeRates,
34-
withdrawals,
35+
createOTokenWithdrawalsProcessor({ oTokenAddress: addresses.oeth.address, from: 20428558 }),
3536
],
3637
postProcessors: [exchangeRatesPostProcessor, dailyStats, processStatus('oeth')],
3738
validators: [validateOeth],

src/model/generated/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,6 @@ export * from "./oethDailyStat.model"
118118
export * from "./oethStrategyDailyStat.model"
119119
export * from "./oethStrategyHoldingDailyStat.model"
120120
export * from "./oethCollateralDailyStat.model"
121-
export * from "./oethRewardTokenCollected.model"
122-
export * from "./oethWithdrawalRequest.model"
123121
export * from "./ognDailyStat.model"
124122
export * from "./ogv.model"
125123
export * from "./ogvAddress.model"
@@ -148,6 +146,8 @@ export * from "./_oTokenActivityType"
148146
export * from "./oTokenDailyStat.model"
149147
export * from "./oTokenDripperState.model"
150148
export * from "./oTokenHarvesterYieldSent.model"
149+
export * from "./oTokenRewardTokenCollected.model"
150+
export * from "./oTokenWithdrawalRequest.model"
151151
export * from "./ousdVault.model"
152152
export * from "./ousdDailyStat.model"
153153
export * from "./ousdStrategyDailyStat.model"

0 commit comments

Comments
 (0)