Skip to content

Commit

Permalink
respecting mev for rewards/apr calc
Browse files Browse the repository at this point in the history
  • Loading branch information
remoterami committed Jun 6, 2024
1 parent 912d245 commit e38280e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/pkg/api/data_access/vdb_summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -592,9 +592,10 @@ func (d *DataAccessService) internal_getElClAPR(validators []t.VDBValidator, day

query = `
SELECT
COALESCE(SUM(fee_recipient_reward), 0)
COALESCE(SUM(GREATEST(rb.value / 1e18, fee_recipient_reward)), 0)
FROM blocks
LEFT JOIN execution_payloads ON blocks.exec_block_hash = execution_payloads.block_hash
LEFT JOIN relays_blocks rb ON blocks.exec_block_hash = rb.exec_block_hash
WHERE proposer = ANY($1) AND status = '1' AND slot >= (SELECT MIN(epoch_start) * $2 FROM %s WHERE validator_index = ANY($1));`
err = db.AlloyReader.Get(&elIncome, fmt.Sprintf(query, table), validators, utils.Config.Chain.ClConfig.SlotsPerEpoch)
if err != nil {
Expand Down

0 comments on commit e38280e

Please sign in to comment.