-
Notifications
You must be signed in to change notification settings - Fork 153
Description
Background
Currently the main way to place an order on cow protocol is to interact with a REST API which is not an onchain interaction. For things like DAO decisions (where people vote on a tx to execute) it is a lot more convenient to be able to place an order by doing an onchain transaction. This is technically already possible using the programmatic order framework but it's a ton of complexity if you just want to place an order onchain.
Details
Supporting onchain order placement would be somewhat similar to how the ethflow works today. We need to build a simple contract that takes the order struct from the user and just emits an event with the same data. The autopilot will then monitor the order placement events coming from that contract and add those orders to the DB.
This will involve:
- building the contract
- deploying it to all the chains we are deployed on
- adding a CLI argument in the autopilot (for the contract address)
- logic in the autopilot to monitor the contract and adding the orders (should be added to autopilot maintenance)
- changes in the infra repo to configure the CLI argument
- e2e test
Since this is just intended as a way to place orders no new DB tables should be needed.