While writing the keeper bot to update price ourselves as a last resort (after a period of unclaimed bounty), I realized one thing that needs improvement:
there is no easy way to simulate if a price update will pay a bounty.
in the previous iteration, keeper would require rpc infra, which simulates an updatePrice call, and then see if the receiving wallet indeed has received a reward
this is quite involved and not just simulating a call and reading its return value
So the proposed solution here is to add a return value such that:
MEV bots and our keeper can easily do a simulated call off chain to see if prices have indeed deviated beyond the threshold
Considerations
I've thought of returning the result as a bool, but decided that a uint256 would be more useful for bots to ascertain the exact rewards applicable
Other improvements
consolidate the ETH transfer in one call instead of transferring the bounty for each hop
fixed a bug where in multiple-hop routes, the threshold for each hop wasn't read
While writing the keeper bot to update price ourselves as a last resort (after a period of unclaimed bounty), I realized one thing that needs improvement:
updatePrice
call, and then see if the receiving wallet indeed has received a rewardSo the proposed solution here is to add a return value such that:
Considerations
bool
, but decided that auint256
would be more useful for bots to ascertain the exact rewards applicableOther improvements