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

Caveats regarding the clamp #226

Open
xenide opened this issue Mar 13, 2024 · 1 comment · May be fixed by #228
Open

Caveats regarding the clamp #226

xenide opened this issue Mar 13, 2024 · 1 comment · May be fixed by #228

Comments

@xenide
Copy link
Contributor

xenide commented Mar 13, 2024

Say on an L2 (e.g. Arbitrum), if the sequencer goes down for a few hours, no swap would be able to take place. As such, the first swap that happens can swing the instant clamped (and of course raw) price a lot. In other words, the clamp becomes quite useless if there are no swaps for an extended period of time, or put it inversely, the clamp works best when there are frequent swaps.

e.g. with a 1bp/s rate of change, if there are no swaps for 2 hours (7200 s), the swap can move the price by 72% and it would not exceed the clamp.

Potential mitigations:

  1. New borrows use the instant price in the case where there has been no oracle observation for X period
  2. Liquidations use a longer TWAP (e.g. 1-hr TWAP) instead of the normal TWAP (10-15 mins)
  3. Clamp the max change within one trade
  • 5% ?
@OliverNChalk
Copy link
Contributor

  1. We clamp the max move in one trade

@xenide xenide linked a pull request Mar 18, 2024 that will close this issue
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 a pull request may close this issue.

2 participants