-
Notifications
You must be signed in to change notification settings - Fork 1
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
Prepare bot for public use #1
Conversation
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.
👍 LGTM overall, just had a few minor comments.
I wonder if the recent patches to the internal OEV bot won't cause issues, but let's see. I'm hopeful it should be managaeble. If not, we can open source this as is. The only prerequisite is to make sure it is working.
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.
I think there is a LOT of extra stuff here that shouldn't be included for an "example" repo that adds to what a reader needs to understand. e.g. console.log
instead of logger
, validating stuff with zod
, sanitising ethers
errors, ProviderWithFallback
/other fallbacks, using immer
instead of just a simple object etc.
In my mind, the focus should be on simplicity & readability as the main priorities so that potential searchers can understand the flow here. I really struggled to understand what was going on after a few functions. Maybe I'm misunderstanding the goal here, but I think there should be two repos:
- The "example" bot which focuses on being the absolute minimum required to get up and running with OEV. It doesn't do fallbacks, fancy logging, validation etc.
- The more advanced bot with all of these nice to have features that is more efficient/resilient.
|
||
This repository contains an example OEV Searcher bot implementation targeting [Orbit Lending](https://orbitlending.io/). | ||
To understand how OEV works, visit | ||
[the OEV documentation](https://oev-docs--pr12-new-oev-docs-0y2wddya.web.app/reference/oev-network/overview/oev-network.html). |
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.
We'll need to remember to update this
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.
We will in the following PR. The docs are WIP as of now.
- Set the value of the target beacon to our transmuted value: `updateBeaconWithSignedData` | ||
- In a single call, apply the transmutation call data and retrieve account liquidity for all accounts | ||
- refer to | ||
[ExternalMulticallSimulator.sol](https://github.com/api3dao/oev-searcher/blob/main/contracts/api3-contracts/utils/ExternalMulticallSimulator.sol) |
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.
this repo is private so the link won't work. I'm not sure what the plans to make it public are though (if there are any)
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.
It should be linked from the main
branch of api3/contracts once this is done
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.
I think there is a LOT of extra stuff here that shouldn't be included for an "example" repo that adds to what a reader needs to understand. e.g. console.log instead of logger, validating stuff with zod, sanitising ethers errors, ProviderWithFallback/other fallbacks, using immer instead of just a simple object etc.
Yeah, I think these are valid simplifications. I've asked @aquarat not to make many code changes though, because we had some more changes+fixes planned in the oev-searcher repo. The plan should be:
- Port the oev-bot code from the oev-searcher repo to this example bot
- Implement simplifications, e.g. the ones you pointed out
In my mind, the focus should be on simplicity & readability as the main priorities so that potential searchers can understand the flow here. I really struggled to understand what was going on after a few functions. Maybe I'm misunderstanding the goal here, but I think there should be two repos:
The "example" bot which focuses on being the absolute minimum required to get up and running with OEV. It doesn't do fallbacks, fancy logging, validation etc.
The more advanced bot with all of these nice to have features that is more efficient/resilient.
That is too much work for little benefit. Imo, we should just have a single working open source implementation showcasing the OEV bot. Any resiliency is just extra complexity and something the user should implement on their own (and we don't need to provide that).
In general I'll try and simplify this much further and then you both can re-review. |
Thanks 👍🏻 I'm fine with follow up PRs too btw
Ok but what is the focus of the "single working open source implementation"? Is it for educating new/potential searchers or is it something anyone can plug & play to compete for OEV (even if there are lots of people running the exact same code)? Or maybe it's the exact OEV bot that API3 is running for everyone to see and outcompete These are different goals to me and strongly affect the direction of what the code will look like. i.e. Should the code be barebones/minimal or should it have lots of extra things to make it more efficient? |
Good questions. It's probably worth discussing on Slack? 🤷 |
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.
Looking great, special thanks for the transmutation details, it was very helpful for me 😄
This is not perfect, but I think it's at the point where others can assist, especially Andre. |
This PR is largely a copy of the orbit-specific OEV searcher bot, but with the following removed:
contract compilationadded back for the Liquidator (to enabled verifiable deployment by the user)Functions have had documentary comments added and the README has been expanded.
The Orbit Liquidator contract's bytecode is included in the cli-utils file to enable deployment of that contract.There is some code to optionally persist accounts to watch (to file) - which may not be desirable 🤷 (Update: this will be addressed in a separate PR)
It's a bit icky but a lot of the recent changes in oev-searcher will probably have to be downstreamed into this repo (in a separate PR).
There are a few temporary links pointing to the draft OEV docs. These will need to be updated once those docs are live.
Closes https://github.com/api3dao/oev-searcher/issues/17