Skip to content
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

Add script-enforced strategies #49

Merged
merged 4 commits into from
Mar 6, 2024
Merged

Conversation

Quantumplation
Copy link
Member

This adds the notion of script-guarded strategies.

In addition to the ability to delegate a strategy to a verification key, you can instead specify a script that must be present on the scoop transaction to enact the strategy.

A scooper would need to be aware to attach this script, but it would allow us to extend the protocol arbitrarily; users could attach scripts to check the correctness of the execution, rather than only relying on verification keys.

This could, for example, be used to check that the price was within a certain range before trading; or that only deposits and withdrawals were supported, not swaps, etc.

To facilitate these scripts, we also add an arbitrary "Extensions" field to pack extra data in the strategy execution that the script could inspect.

@Quantumplation Quantumplation merged commit 3f95924 into main Mar 6, 2024
1 check passed
@Quantumplation Quantumplation deleted the pi/script-strategies branch March 6, 2024 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants