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 force-exercising buyers of a market maker's stuck position #37

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

Comments

@flanagansteve
Copy link
Collaborator

flanagansteve commented Sep 20, 2024

The gateway endpoint should:

  • Accept a stuck position ID, and confirm you cannot burnOptions on it
    - Attempt to force exercise the position - if that's not possible because the position is chained to other stuck positions, then:
    - Attempt a second level of force exercising (so if a user required to be exercised is blocked try running the algo on their position), tries to bruteforce combinations of positions (e.g., see if one can force exercise each position in the next level in the chain, freeing the target position to be force exercised)
    - And as a second backup, if the stuck position is stuck because of a long leg that does not have countervailing liquidity, consider: adding liquidity, force exercising, then removing the liquidity. This will not work however if that leg is attached to a short leg that does have liquidity, for example.
  • [Nice to have] Also consider liquidation as an option for each step - e.g., check if you can force exercise the buyer of the position, or if their account is liquidatable which would also free you; then also add this logic into your second-level checks

Then, any logic that attempts to close positions - for example, to close an out-of-range position to re-open a new one that's in range - should use this if the burnOptions call fails

We should consider how to trade off force exercising as an option against just reducing the size of a position and waiting: #36

As well as trading off more generally against volatility of the asset - e.g. you don't want to be too jumpy in scenarios where the price is likely to come back in range anyways

@flanagansteve flanagansteve changed the title Add endpoint for force-exercising buyers of a market maker's stuck position, and use it on-tick when trying to close positions Add Gateway method for force-exercising buyers of a market maker's stuck position Sep 20, 2024
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