-
Notifications
You must be signed in to change notification settings - Fork 86
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
feat: Add some subscription logic to the cow API. #2125
Comments
Don't we already populate the auction id on each instance we send to solvers (code)? With this id you should be able to query https://api.cow.fi/docs/#/default/get_api_v1_solver_competition__auction_id_ to get your ranking. @marcovc can you confirm this is working and close this issue in that case? |
Right, the issue is that then either the solver needs to also do the monitoring (which I think is a bad idea given that the solver is the "mission critical" part), or the solver needs to tell an external container responsible for monitoring that a new auction id was generated (which is what I am now doing, but seems like a unnecessarily convoluted path). |
I see. Would #1945 solve the issue? Adding websocket support to our API seems like a big endeavour that I don't see happening in the near future. |
That would solve it indeed. I suppose you guys are used to solvers continuously polling the endpoints anyway :) Thanks |
Problem
Given that notify stopped notifying about the rank in the co-located setup, to be able to monitor if a solver wins an auction we need to query the cow API. For this, we need to know the batch id, which is I suppose is only provided in the solve() call.
In order to keep the monitoring logic separated from my solver, I have a dedicated process that just monitors the competition, and stores whatever is needed. This process does not get a notify call, so it does not know the latest auction id.
Suggested solution
Maybe there is a way I am not aware of, but would be nice if I could just subscribe some websocket to be informed of new auctions, or at least some endpoint I could keep polling.
Alternatives considered
An alternative is to listen to the smartcontract submission events, which gives a txhash that can also be used to query about the settlement. But unfortunately, querying with a txhash is only possible 30 minutes or so after the settlement happened, which does not provide an updated monitoring.
The text was updated successfully, but these errors were encountered: