Add a special 'Self' destination variant #62
Merged
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.
We want to allow recurring automated strategies that can execute in multiple stages.
The idea behind this was to allow setting the destination back to the order script with a "strategy" order details.
However, this overlooks the fact that this would require setting a destination datum hash. This means that our order executions would have a finite depth.
So, this commit adds a new variant to the Destination, which enforces that the results of the swap are paid back to the same address, with the same datum.
Thus, we could construct the order datum:
and the output order datum will be... the same thing.
Some notes: