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

Faster TWAPs with smaller parts #5329

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft

Conversation

anxolin
Copy link
Contributor

@anxolin anxolin commented Jan 22, 2025

Twap reduce restrictions

Experimental PR to reduce drastically the restrictions for TWAP orders.

Relax Time

I allow here, for dramatic porpoises, to place a order every 15s (before 300s --> 5min )

Relax order size

Additionally, I reduced the minum trade size for Gnosis Chain, Base and Arbitrum.

  • Gnosis: $5 ---> $0.10
  • Arbitrum, Base: 5$ ---> 1$

Allow more time to execute the orders

Before this PR discrete orders expire when the next part epoc starts.

This PR suggests a minimum of 30min in which orders are open. This way, it leaves more time for orders to execute.

This way, you can send orders every 15s, but they will be batched in the same block if they are active concurrently OPEN.
There could be other potential logic for the duration, I just used 30min as it is the default SWAP deadline.

My test

I was able to place the order
Screenshot at Jan 22 22-32-06

It created this weird effect and the order expired before executing. Watch-tower didn't even place the order!

trimmed.mov

This shows some issues

However, this shows how the order's table show some wrong data.

  • The countdown for expiration starts to go down as I place the order (before the TX gets mined). I believe this is wrong. The expiration is given in time (60seconds in this case) after mining time. While signing the clock shouldn't be ticking.
  • The orders table is confusing (to see the 60s left, and then 30min expiration)
  • The creation time says 30min, but is not true, the order should be created in a few seconds (unless my TWAP creation is wrong)
  • Watch Tower didn't place the orders fast enough. I would expect it to be quick --> after order mining it should

Follow ups

We should

  • Fix the UI issues above
  • Double check why watchtower didn't even place the order. place the orders
  • Relax the time, but maybe 15seconds is too much!
  • Double check the new amounts make sense
  • Battle test the new logic for the minimum deadline of 30min
  • Test is ok for the UI to have more than one TWAP part OPEN (before, only one was open)

Copy link

vercel bot commented Jan 22, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
cosmos ✅ Ready (Inspect) Visit Preview Jan 22, 2025 10:53pm
cowfi ✅ Ready (Inspect) Visit Preview Jan 22, 2025 10:53pm
explorer-dev ✅ Ready (Inspect) Visit Preview Jan 22, 2025 10:53pm
sdk-tools ✅ Ready (Inspect) Visit Preview Jan 22, 2025 10:53pm
swap-dev ✅ Ready (Inspect) Visit Preview Jan 22, 2025 10:53pm
widget-configurator ✅ Ready (Inspect) Visit Preview Jan 22, 2025 10:53pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DONT_MERGE Indicates the PR should not be merged. Probably a WIP or PoC.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant