cowprotocol / cow-sdk

CoW protocol SDK
https://docs.cow.fi/cow-protocol/reference/sdks/cow-sdk
Other
31 stars 9 forks source link

Handle twap in orderbook #169

Closed anxolin closed 12 months ago

anxolin commented 1 year ago

image

This PR implements and test the logic in TWAP that instructs the watch-towers what is the next polling time for the case, the current part is already in the order book.

This is very important for the scalability of watch towers, since otherwise they would need to check on every block. This PR will allow a DCA that executes once a month, to be polled only once a month (two at most, since first polling returns the current part, and next polling for the same period will instruct to wait for approximately one month )

The test will cover various edge cases in the execution of a 10 parts TWAP order. Read the tests for more details. As a summary:

Test

yarn test

github-actions[bot] commented 1 year ago

CLA Assistant Lite bot:
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request

coveralls commented 1 year ago

Coverage Status

coverage: 79.121% (+1.8%) from 77.295% when pulling f6e5f5a800a80ea97015974804b167394fdb44bb on handle-twap-in-orderbook into a026ae18d4918d72744876aab767e258ac8b7b72 on main.