Skip to content
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

round opps strandard deviation report #248

Closed
wants to merge 5 commits into from
Closed

Conversation

rouzwelt
Copy link
Collaborator

@rouzwelt rouzwelt commented Nov 4, 2024

Motivation

reports opps standard deviation for each round against avg of x number of previous rounds
addresses #247

Solution

Tackling reporting on drops in execution (found opps irrespective of whether they got actually cleared by bot successfully or got frontrun or tx failed or ...).
keeping track of counts of opps across x number of previous rounds (x latest rounds), by each passing round a new count is returned, we can check the new number against the standard deviation of previous rounds, subtracting the 2 values will give us the difference from the norm of x previous rounds, so any value below 0 means it has hit the lower bounds of stdvs and then on hyperdx can setup an alert to go off, also can apply how many levels below 0 to deviate before alert goes off, like if we deviate more than 1, 2, 3, ... levels below the stdvs, then alert should go off.
This will hint to the anomaly that occured for the current round, many reasons can cause this, such as orders got removed, market moved rapidly and some orders cant correctly adapt and may need redeployments, orders' vaults got emptied, rpcs are ratelimiting, etc etc.
Next configuraion can come into play in hyperdx to set an occurance number for the anomalies count across y span of time. Meaning, maybe 1 anomaly 1 time, isnt really something that concerning as it can be as a result of examples above such as orders got removed, but if that happens more than once across let's say an hour, it can indicate to something other than expected reasons.
These are configurable per bot per chain on hyperdx, and each can have their own set of thresholds.
Good part about this approach is that, it will not stay fixed on a value and continue alerting forever, but rather it is always adapting to latest x number of rounds that bot reports about, as number of orders change and each order quote/vaults/clearing situation changes over time so does the stdvs, making it a more dynamic and flexible approach to check for bot's possible execution drops and anomalies.

Checks

By submitting this for review, I'm confirming I've done the following:

  • made this PR as small as possible
  • unit-tested any new functionality
  • linked any relevant issues or PRs
  • included screenshots (if this involves a front-end change)

@rouzwelt rouzwelt added enhancement New feature or request update Update Inner Logic labels Nov 4, 2024
@rouzwelt rouzwelt self-assigned this Nov 4, 2024
@rouzwelt rouzwelt closed this Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request update Update Inner Logic
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant