diff --git a/oracle/networks.py b/oracle/networks.py index 2a21cac..17520be 100644 --- a/oracle/networks.py +++ b/oracle/networks.py @@ -90,6 +90,11 @@ SYNC_PERIOD=timedelta(days=1), IS_POA=False, DEPOSIT_TOKEN_SYMBOL="ETH", + VALIDATORS_SPLIT={ + Web3.toChecksumAddress("0xfe26832d3580e0ade4813f9e60e7c17b45e92cba"): 64, + Web3.toChecksumAddress("0x59ecf48345a221e0731e785ed79ed40d0a94e2a5"): 63, + Web3.toChecksumAddress("0x01f26d7f195a37d368cb772ed75ef70dd29700f5"): 64, + }, ), HARBOUR_MAINNET: dict( STAKEWISE_SUBGRAPH_URLS=config( @@ -164,6 +169,7 @@ SYNC_PERIOD=timedelta(days=1), IS_POA=False, DEPOSIT_TOKEN_SYMBOL="ETH", + VALIDATORS_SPLIT={}, ), GOERLI: dict( STAKEWISE_SUBGRAPH_URLS=config( @@ -235,6 +241,7 @@ SYNC_PERIOD=timedelta(hours=1), IS_POA=True, DEPOSIT_TOKEN_SYMBOL="ETH", + VALIDATORS_SPLIT={}, ), HARBOUR_GOERLI: dict( STAKEWISE_SUBGRAPH_URLS=config( @@ -309,6 +316,7 @@ SYNC_PERIOD=timedelta(days=1), IS_POA=True, DEPOSIT_TOKEN_SYMBOL="ETH", + VALIDATORS_SPLIT={}, ), GNOSIS_CHAIN: dict( STAKEWISE_SUBGRAPH_URLS=config( @@ -380,5 +388,9 @@ SYNC_PERIOD=timedelta(days=1), IS_POA=True, DEPOSIT_TOKEN_SYMBOL="GNO", + VALIDATORS_SPLIT={ + Web3.toChecksumAddress("0x59ecf48345a221e0731e785ed79ed40d0a94e2a5"): 4971, + Web3.toChecksumAddress("0xf37c8f35fc820354b402054699610c098559ae44"): 4971, + }, ), } diff --git a/oracle/oracle/distributor/common/eth1.py b/oracle/oracle/distributor/common/eth1.py index 68f882e..417ffaa 100644 --- a/oracle/oracle/distributor/common/eth1.py +++ b/oracle/oracle/distributor/common/eth1.py @@ -167,6 +167,7 @@ async def get_operators_rewards( to_block: BlockNumber, total_reward: Wei, reward_token_address: ChecksumAddress, + validators_split: dict, ) -> Tuple[Rewards, Wei]: """Fetches operators rewards.""" result: Dict = await execute_sw_gql_query( @@ -187,7 +188,9 @@ async def get_operators_rewards( if account == EMPTY_ADDR_HEX: continue - validators_count = int(operator["validatorsCount"]) + validators_count = int(operator["validatorsCount"]) + validators_split.get( + account, 0 + ) total_validators += validators_count revenue_share = int(operator["revenueShare"]) diff --git a/oracle/oracle/distributor/controller.py b/oracle/oracle/distributor/controller.py index c5914a9..3629c3b 100644 --- a/oracle/oracle/distributor/controller.py +++ b/oracle/oracle/distributor/controller.py @@ -168,6 +168,7 @@ async def process(self, voting_params: DistributorVotingParameters) -> None: to_block=to_block, total_reward=protocol_reward, reward_token_address=NETWORK_CONFIG["REWARD_TOKEN_CONTRACT_ADDRESS"], + validators_split=NETWORK_CONFIG["VALIDATORS_SPLIT"], ) partners_rewards, left_reward = await get_partners_rewards( network=NETWORK,