Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/mainnet/processors/native-staking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import * as beaconAbi from '@abi/beacon-deposit-contract'
import { BeaconDepositEvent, BeaconDepositPubkey } from '@model'
import { Block, Context } from '@processor'
import { EvmBatchProcessor } from '@subsquid/evm-processor'
import { OETH_NATIVE_STRATEGY_ADDRESSES } from '@utils/addresses'
import { OETH_NATIVE_STRATEGIES } from '@utils/addresses'
import { logFilter } from '@utils/logFilter'
import { readLinesFromUrlInBatches } from '@utils/readLinesFromUrlInBatches'

export const from = 20029793 // Dump contains pubkeys up until 20029793.

const beaconDepositContractAddress = '0x00000000219ab540356cbb839cbe05303d7705fa'
const withdrawCredentials = OETH_NATIVE_STRATEGY_ADDRESSES.map(
(address) => `0x010000000000000000000000${address.slice(2)}`,
const withdrawCredentials = OETH_NATIVE_STRATEGIES.map(
(strategy) => `0x010000000000000000000000${strategy.address.slice(2)}`,
)

const beaconDepositFilter = logFilter({
Expand Down
47 changes: 19 additions & 28 deletions src/oeth/processors/strategies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
ETH_ADDRESS,
FRXETH_ADDRESS,
OETH_ADDRESS,
OETH_NATIVE_STRATEGY_ADDRESSES,
OETH_NATIVE_STRATEGIES,
OETH_VAULT_ADDRESS,
RETH_ADDRESS,
STETH_ADDRESS,
Expand Down Expand Up @@ -139,38 +139,29 @@ export const oethStrategies: readonly IStrategyData[] = [
decimals: 18,
})),
},
{
chainId: 1,
from: 20046251,
name: 'OETH Native Staking 1',
contractName: 'NativeStakingSSVStrategy',
address: OETH_NATIVE_STRATEGY_ADDRESSES[0],
oTokenAddress: OETH_ADDRESS,
kind: 'NativeStaking',
base: { address: WETH_ADDRESS, decimals: 18 },
assets: [WETH_ADDRESS].map((address) => ({ address, decimals: 18 })),
earnings: { passiveByDepositWithdrawal: true, rewardTokenCollected: true },
},
{
chainId: 1,
from: 20290461,
name: 'OETH Native Staking 2',
contractName: 'NativeStakingSSVStrategy',
address: OETH_NATIVE_STRATEGY_ADDRESSES[1],
oTokenAddress: OETH_ADDRESS,
kind: 'NativeStaking',
base: { address: WETH_ADDRESS, decimals: 18 },
assets: [WETH_ADDRESS].map((address) => ({ address, decimals: 18 })),
earnings: { passiveByDepositWithdrawal: true, rewardTokenCollected: true },
},
...OETH_NATIVE_STRATEGIES.map(
(strategy, index) =>
({
chainId: 1,
from: strategy.from,
name: `OETH Native Staking ${index + 1}`,
contractName: 'NativeStakingSSVStrategy',
address: strategy.address,
oTokenAddress: OETH_ADDRESS,
kind: 'NativeStaking',
base: { address: WETH_ADDRESS, decimals: 18 },
assets: [WETH_ADDRESS].map((address) => ({ address, decimals: 18 })),
earnings: { passiveByDepositWithdrawal: true, rewardTokenCollected: true },
}) as const,
),
]

const strategies = oethStrategies

const eventProcessors = [
...OETH_NATIVE_STRATEGY_ADDRESSES.map((address) =>
...OETH_NATIVE_STRATEGIES.map((strategy) =>
createEventProcessor({
address,
address: strategy.address,
event: nativeStakingAbi.events.AccountingConsensusRewards,
from: 20046251,
mapEntity: (ctx, block, log, decoded) =>
Expand All @@ -179,7 +170,7 @@ const eventProcessors = [
chainId: ctx.chain.id,
timestamp: new Date(block.header.timestamp),
blockNumber: block.header.height,
address,
address: strategy.address,
rewards: decoded.amount,
}),
}),
Expand Down
10 changes: 5 additions & 5 deletions src/utils/addresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ export const CURVE_ETH_OETH_POOL_ADDRESS = '0x94b17476a93b3262d87b9a326965d1e91f
export const OETH_FRAX_STAKING_ADDRESS = '0x3ff8654d633d4ea0fae24c52aec73b4a20d0d0e5'
export const OETH_MORPHO_AAVE_ADDRESS = '0xc1fc9e5ec3058921ea5025d703cbe31764756319'
export const OETH_STRATEGY_BALANCER_ADDRESS = '0x49109629ac1deb03f2e9b2fe2ac4a623e0e7dfdc'
export const OETH_NATIVE_STRATEGY_ADDRESSES = [
'0x34edb2ee25751ee67f68a45813b22811687c0238',
'0x4685db8bf2df743c861d71e6cfb5347222992076',
'0xe98538a0e8c2871c2482e1be8cc6bd9f8e8ffd63',
export const OETH_NATIVE_STRATEGIES = [
{ address: '0x34edb2ee25751ee67f68a45813b22811687c0238', from: 20046251 },
{ address: '0x4685db8bf2df743c861d71e6cfb5347222992076', from: 20290461 },
{ address: '0xe98538a0e8c2871c2482e1be8cc6bd9f8e8ffd63', from: 21127497 },
]
export const OETH_NATIVE_STRATEGY_FEE_ACCUMULATOR_ADDRESS = '0x7ed4ccb74a1ee903af5fbd9be00ca8616f23d627'
export const OETH_VAULT_ERC20_ADDRESSES = [WETH_ADDRESS, STETH_ADDRESS, RETH_ADDRESS, FRXETH_ADDRESS]
Expand Down Expand Up @@ -131,7 +131,7 @@ export const strategies = {
FraxETHStrategy: '0x3ff8654d633d4ea0fae24c52aec73b4a20d0d0e5',
MorphoAaveStrategy: '0xc1fc9e5ec3058921ea5025d703cbe31764756319',
BalancerMetaPoolStrategy: '0x49109629ac1deb03f2e9b2fe2ac4a623e0e7dfdc',
NativeStakingStrategies: OETH_NATIVE_STRATEGY_ADDRESSES,
NativeStakingStrategies: OETH_NATIVE_STRATEGIES.map((s) => s.address),
},
ousd: {
ConvexOUSDMetaStrategy: '0x89eb88fedc50fc77ae8a18aad1ca0ac27f777a90',
Expand Down