-
Notifications
You must be signed in to change notification settings - Fork 262
Prevent balanced strategy from modifiying orders when nothing has changed #52
Comments
@Reidmcc this is a good idea. balancedLevelProvider can save (in memory) it's asset balances and the levels it returns from the GetLevels call. Anytime we call GetLevels it can first check if the asset balances have changed from what it has saved in memory:
This will be a pretty quick and simple code change. The suggested approach will not consider amount tolerances since any balance change will trigger levels to be recomputed. Adjusting this to handle amount tolerances can be worked on as a separate issue which is a relatively small improvement over the suggested approach. |
That makes sense. Do you have the code change planned out or shall I take a crack at it? |
@Reidmcc The approach described above is what I had been thinking about for a while but never got to making the change. Would be great if you could take a crack at it! |
Ok, will do. |
@Reidmcc I've uploaded the fill tracking and handling logic, you can take a look at how that works for the mirror strategy as an example: https://github.com/interstellar/kelp/blob/master/plugins/mirrorStrategy.go#L312 |
Desired Behavior
Currently, if the balanced strategy has LEVEL_DENSITY < 1.0 it will modify its orders to re-randomize the levels even if no offers have been taken.
I want to have the balanced strategy leave all levels in place if no trades have happened since the last refresh; I don't think re-randomizing is useful when nothing has changed.
Impact
The current behavior submits unnecessary operations to the network. This change will increase efficiency and reduce user fee spending.
Feature Suggestion
We can implement this by having the bot stop modifying offers if the first offer is still in place and within tolerances. I'm submitting a pull request shortly.
The text was updated successfully, but these errors were encountered: