Open
Conversation
Philogy
suggested changes
Feb 21, 2025
Contributor
Philogy
left a comment
There was a problem hiding this comment.
Core logic (_invalidatePartTWAPNonceAndCheckDeadline) needs some work, also some details here and there but largely good.
contracts/src/Angstrom.sol
Outdated
| console.log("updated pools"); | ||
| reader = _validateAndExecuteToBOrders(reader, pairs); | ||
| console.log("exectued tob"); | ||
| console.log("executed tob"); |
Contributor
There was a problem hiding this comment.
Shouldn't be there in the first place but remove the console.log
contracts/docs/payload-types.md
Outdated
| |`start_time: u40`|The unix timestamp from which the order becomes valid (or, after which the order is considered active). | | ||
| |`total_parts: u32`| The maximum number of times the twap order can be executed. | | ||
| |`time_interval: u32`| The required period between consecutive twap orders. | | ||
| |`window: u32`| The specified period when twap orders can be executed. | No newline at end of file |
Contributor
There was a problem hiding this comment.
Not entirely clear what this is just from the docs start_time + window is end time?
Author
There was a problem hiding this comment.
yes, but more specifically at each interval.
Comment on lines
+119
to
+122
| nonce := and(nonce, MASK_U64) | ||
| mstore(12, div(nonce, MAX_TWAP_NONCE_SIZE)) | ||
| mstore(4, UNORDERED_TWAP_NONCES_SLOT) | ||
| mstore(0, owner) |
Contributor
There was a problem hiding this comment.
Besides the memory manipulation most of this does not have to be in assembly and in fact it makes it very hard to read
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
adds support for TWAP orders on Angstrom by allowing users to authorize/sign a single order that can be executed multiple times at fixed intervals.