auto loopin: consider settled invoices swap succeeded #636
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR allows the auto loop-in dispatcher to continue with the execution of the next swap once a previous swap's invoice is settled.
Set parameters
Set rule
Result:
A new swap is dispatched although the previous swap is still in a pending state
Accounting considerations:
To deal with pending swap fees the auto loop-in engine temporarily assigns pending swaps the maximum allowed fees so to not overshoot the set budget. Once the swap finalizes the actual fees(likely lower) will be set on the swap and the auto-loop dispatcher will reevaluate the creation of a new swap if it was previously blocked by an elapsed budget.
As an example, we could create many swaps in settled state that temporarily chew up our budget - but once the swaps finalize and capital frees new swaps might be dispatched.