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(twap): unlimited twap deadline #3568

Merged
merged 9 commits into from
Jan 4, 2024
Merged

Conversation

alfetopito
Copy link
Collaborator

Summary

Follow up to and waterfalls into #3567

Another low hanging fruit from 2024 roadmap

TWAP orders in theory have no duration limit.
The only restriction is that each individual part can not be longer than 6 months.

This change:

  1. Removes the 6 months limit for TWAP duration
  2. Adds the limit for individual part duration
  3. Also adds human friendly display for time in years and months (albeit not very precise...)

Screenshot 2023-12-29 at 17 20 00

To Test

  1. Open the app as a Safe App
  2. Go to TWAP tab
  3. Fill in the form and pick a custom order duration
  4. Insert 9000 hours (rounding 1y up) and 2 parts
  • You should be allowed to pick more than 4400 hours (rounding up 6 months)
  • You should see a warning about the part time being too long
  • You should not be able to place the TWAP
  1. Increase the number of parts by 1
  • Warnings should be gone
  • You should be able to place the order

Notes

  • The new year and month calculation is not very precise.
    Thus, you'll see the limit as 6 months and 12h, when in fact it's 182d + 12h
    image

  • The duration picker is still using hours and minutes
    I'm aware it could use some updating, but it's out of the scope of this change.

@alfetopito alfetopito self-assigned this Dec 29, 2023
@alfetopito alfetopito requested a review from a team December 29, 2023 17:37
Copy link

vercel bot commented Dec 29, 2023

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

Name Status Preview Updated (UTC)
cosmos ✅ Ready (Inspect) Visit Preview Jan 3, 2024 11:23am
swap-dev ✅ Ready (Inspect) Visit Preview Jan 3, 2024 11:23am
widget-configurator ✅ Ready (Inspect) Visit Preview Jan 3, 2024 11:23am

@alfetopito alfetopito force-pushed the feat/max-limit-order-deadline branch from 75624b5 to 1499733 Compare January 3, 2024 10:40
Base automatically changed from feat/max-limit-order-deadline to develop January 3, 2024 11:06
@alfetopito alfetopito requested review from shoom3301 and a team January 3, 2024 11:49
@alfetopito alfetopito merged commit 378977c into develop Jan 4, 2024
9 of 10 checks passed
@alfetopito alfetopito deleted the feat/unlimited-twap-deadline branch January 4, 2024 10:09
@github-actions github-actions bot locked and limited conversation to collaborators Jan 4, 2024
@elena-zh
Copy link

elena-zh commented Jan 9, 2024

Works with some issues I reported in #3591 and #3592

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants