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

feat: interface function to hint when order in book #74

Open
1 task
mfw78 opened this issue Sep 19, 2023 · 0 comments
Open
1 task

feat: interface function to hint when order in book #74

mfw78 opened this issue Sep 19, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@mfw78
Copy link
Contributor

mfw78 commented Sep 19, 2023

Problem

It became frustrating with our experience when optimising the tenderly-watch-tower that there may be times when the conditional order type wants to provide custom logic to the watch tower for how it should respond when an order is already in the book. For example, if the order is already in the book, in the event of a TWAP, it's best to wait until the next part.

Suggested solution

Given that this requires off-chain input (ie. the mere fact that the order is in the book), the suggested solution is to specify a function such as handle(address owner, address sender, bytes32 ctx, bytes calldata staticInput, bytes calldata offChainInput, uint8 offChainState). offChainState would be an enum and allow for extensibility if there become other cases that we would like to handle.

Alternatives considered

An alternative to this is implementing specific logic in the cow-sdk for each custom order type. Ideally we rule this out so that cow-sdk logic can try to be as order-agnostic as possible, with the specific instructions coming as a "source of truth" from conditional order contract.

Additional context

N/A

Acceptance criteria

  • Interface is defined for handling abstract off-chain state.
@mfw78 mfw78 self-assigned this Sep 19, 2023
@mfw78 mfw78 added the enhancement New feature or request label Sep 19, 2023
@mfw78 mfw78 removed their assignment Sep 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant