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

Add Gateway method for reducing the size of a position #36

Open
flanagansteve opened this issue Sep 20, 2024 · 0 comments
Open

Add Gateway method for reducing the size of a position #36

flanagansteve opened this issue Sep 20, 2024 · 0 comments

Comments

@flanagansteve
Copy link
Collaborator

flanagansteve commented Sep 20, 2024

Sometimes, you can't close a position, and burnOptions fails, because someone has bought a small amount of your position. In those cases, we should allow the bot to reduce the size of the position (if the gas costs justify it) - for example, if you were selling 10 ETH worth of calls and someone bought 0.01 ETH, having 10ETH that is un-burnable is a pretty big opportunity cost - but reducing the size of the position will only cost some gas while freeing that capital.

We should think about how this trades off against:

  • gas cost
  • time - maybe if you waited a bit the conditions would change and you wouldn't need to reduce size at all
  • force exercising - maybe paying the force exercise fee is worth it in exchange for freeing all your capital

But, when it makes sense, we should use this on-tick in strategies when a simple burnOptions call fails (for example, when you're trying to close an out-of-range position to re-open in-range ones)

Can look to the logic in the UI for design inspiration on how to reduce size

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