-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a special 'Self' destination variant
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: ``` OrderDatum { pool_ident: ..., owner: ..., max_protocol_fee: ..., destination: Self, details: Strategy { ... }, extension: ... } ``` and the output order datum will be... the same thing. Some notes: - We make sure it's the *second* variant, which should mean that it doesn't change the offchain code - This doesn't make a whole lot of sense for any other variant; should we only allow it for strategies? Unless the auditors come up with a problem, I don't see a reason to restrict it.
- Loading branch information
1 parent
e6f282f
commit 7a92750
Showing
7 changed files
with
143 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.