Skip to content

Conversation

@anxolin
Copy link
Owner

@anxolin anxolin commented Sep 10, 2025

PoC for placing TWAP orders from an EOA.

It uses the contracts and the flow described in: cowdao-grants/cow-shed#53

The TLDR of the PoC is:

  • We place a BUY order of the amount you want to sell in the TWAP. The recipient is cow-shed
  • A post-hook creates the TWAP order and do the needed approvals
  • Watch-tower creates the orders from cow-shed when the time is right

Here is an example: https://explorer.cow.fi/gc/orders/0x3147952a280a4cac0ea681f2fa451e6eb1dec29fd478e9bde2a213a33ffc47ab016f34d4f2578c3e9dffc3f2b811ba30c0c9e7f368c1c1a3?tab=overview

This solution still have 2 drawbacks

  • Its not capital efficient for orders/TWAPs that expand over long periods of times, because the full amount of the order flows to the intermediate token immediatly, and then is TWAP over time. We will try to work now on a JIT pulling of funds for TWAP
  • It depends on sell=buy for the first order that creates the TWAP. Meaning a dependency with backend. I consider this doesn't block the start of the FE work, because they can do as we did in our PoC, and sell a different token, but is a dependency for launching it

Test

Requirements

  • Make sure you add your PK in the env
  • Make sure your Gnosis account has at least 0.1 wxDAI

Run the script

yarn dev

@anxolin anxolin changed the title Add script to post TWAP from EOA End-end script to post TWAP from EOA Sep 11, 2025
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