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

[lease] Implement Max-Impact on swaps #365

Open
gmanev7 opened this issue Jul 9, 2024 · 0 comments
Open

[lease] Implement Max-Impact on swaps #365

gmanev7 opened this issue Jul 9, 2024 · 0 comments

Comments

@gmanev7
Copy link
Member

gmanev7 commented Jul 9, 2024

Currently, we are tolerant at max on the price impact swap transactions might incur. On Osmosis we accept whatever impact, whereas on Astroport the DEX limits that to 50%.

The recent market fluctuations called for a more conservative solution. It would only process swap transactions above a pre-configured minimum price impact. The immature DEX APIs make error recognition tough, if not impossible. Therefore our solution should be generic and applicable to other error types on swapping.

Our initial analysis has concluded with a solution that asks for a more restrictive maximum impact calculated based on the last price obtained from the oracle. We have listed the following options, though:

  1. A swap failure waits for manual healing.
  2. A swap failure immediately triggers another transaction attempt by fetching a fresh spot price from the oracle.
  3. A swap failure sets a time alarm for a pre-configured time that would do what option 2. would have done immediately.
    2'. 2 + execute the swap operation without max-impact if the transactions have fallen for a given pre-configured timeout.
    3'. 3 + execute the swap operation without max-impact if the transactions have fallen for a given pre-configured timeout.

An open question:

  • should we apply the same swapping policy for all swapping instances, for example, buy the asset on opening, buy LPN at payment, sell an asset on partial closure, or only upon liquidation?
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

No branches or pull requests

1 participant