-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Copium Capital MEV Blocker kickbacks #112
Merged
Merged
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
be76322
add copium kickbacks
harisang e8a4698
minor rename
harisang e31aa44
black fix
harisang e095389
Address comments
harisang a4e70e4
fix name
harisang 50d4e82
Update to python 3.12 (#113)
harisang 25e0a6e
Revert "Update to python 3.12 (#113)"
harisang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -7,7 +7,8 @@ | |||||||||||||||||
from src.monitoring_tests.base_test import BaseTest | ||||||||||||||||||
from src.apis.web3api import Web3API | ||||||||||||||||||
from src.constants import ( | ||||||||||||||||||
MEV_BLOCKER_KICKBACKS_ADDRESS, | ||||||||||||||||||
COW_DAO_MEV_BLOCKER_KICKBACKS_ADDRESS, | ||||||||||||||||||
COPIUM_CAPITAL_MEV_BLOCKER_KICKBACKS_ADDRESS, | ||||||||||||||||||
KICKBACKS_ALERT_THRESHOLD, | ||||||||||||||||||
) | ||||||||||||||||||
|
||||||||||||||||||
|
@@ -31,19 +32,30 @@ def run(self, tx_hash: str) -> bool: | |||||||||||||||||
if block_number is None: | ||||||||||||||||||
return False | ||||||||||||||||||
|
||||||||||||||||||
total_eth_kickbacks = self.web3_api.get_eth_transfers_by_block_range( | ||||||||||||||||||
block_number, block_number, MEV_BLOCKER_KICKBACKS_ADDRESS | ||||||||||||||||||
cow_dao_total_eth_kickbacks = self.web3_api.get_eth_transfers_by_block_range( | ||||||||||||||||||
block_number, block_number, COW_DAO_MEV_BLOCKER_KICKBACKS_ADDRESS | ||||||||||||||||||
) | ||||||||||||||||||
if total_eth_kickbacks is None: | ||||||||||||||||||
copium_capital_total_eth_kickbacks = ( | ||||||||||||||||||
self.web3_api.get_eth_transfers_by_block_range( | ||||||||||||||||||
block_number, block_number, COPIUM_CAPITAL_MEV_BLOCKER_KICKBACKS_ADDRESS | ||||||||||||||||||
) | ||||||||||||||||||
) | ||||||||||||||||||
eth_kickbacks = None | ||||||||||||||||||
if cow_dao_total_eth_kickbacks is not None: | ||||||||||||||||||
eth_kickbacks = cow_dao_total_eth_kickbacks | ||||||||||||||||||
if copium_capital_total_eth_kickbacks is not None: | ||||||||||||||||||
eth_kickbacks = copium_capital_total_eth_kickbacks | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||
|
||||||||||||||||||
if eth_kickbacks is None: | ||||||||||||||||||
return False | ||||||||||||||||||
log_output = "\t".join( | ||||||||||||||||||
[ | ||||||||||||||||||
"MEV Blocker kickbacks test:", | ||||||||||||||||||
f"Tx Hash: {tx_hash}", | ||||||||||||||||||
f"Kickback: {total_eth_kickbacks:.5f}ETH", | ||||||||||||||||||
f"Kickback: {eth_kickbacks:.5f}ETH", | ||||||||||||||||||
] | ||||||||||||||||||
) | ||||||||||||||||||
if total_eth_kickbacks >= KICKBACKS_ALERT_THRESHOLD: | ||||||||||||||||||
if eth_kickbacks >= KICKBACKS_ALERT_THRESHOLD: | ||||||||||||||||||
self.alert(log_output) | ||||||||||||||||||
else: | ||||||||||||||||||
self.logger.info(log_output) | ||||||||||||||||||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to write the code as
And also add all other external drivers?
The rest of the code would need to be adapted as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah good suggestion, just pushed an update