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

Closeable markets #118

Open
armaniferrante opened this issue May 5, 2021 · 8 comments
Open

Closeable markets #118

armaniferrante opened this issue May 5, 2021 · 8 comments
Labels
composition Changes needed for programs composing with the dex priority:1

Comments

@armaniferrante
Copy link
Contributor

There should be an instruction for one to close dead markets to retrieve the rent exemption SOL.

@valekar
Copy link

valekar commented May 17, 2021

@armaniferrante Is anyone working on this? Looks this is a burning topic that needs to resolved for saving money for the current hackathon. If not, I can work on this in my free time.

@armaniferrante
Copy link
Contributor Author

Not currently and I don't expect this to be in the next DEX release. @sconybeare would be the person to consult for dev planning w.r.t. this feature.

@valekar
Copy link

valekar commented May 18, 2021

@armaniferrante Thanks for the info. @sconybeare Any idea about this feature ?

@tomjohn1028
Copy link

@armaniferrante @sconybeare @valekar put me in coach! PsyOptions needs this. How can I help?

@valekar
Copy link

valekar commented May 26, 2021

@tomjohn1028 - I am trying to understand the codebase. May be I might require help in code reviewing. Once I am done, I will create a PR :)

@valekar
Copy link

valekar commented May 26, 2021

@armaniferrante , @sconybeare - Myself and @tomjohn1028 had an architectural overview on how to solve this problem.

Our initial idea -

  1. Add a new PublicKey to the Market meta data that indicates the closing_authority. This key can only be set when initialising. If the key is not present the market cannot be closed.

  2. Create a new instruction for closing a market. This instruction must be signed by the closing_authority. It cancels all orders, unwinds, and closes the market

Drawback - This approach would have trust issues.
To alleviate this issue, we could introduce time based Market -

  1. There will be no fills for X time
  2. The market unlocks closeable Market instruction after X time.

Any idea or if you already have an architecture ready for this, it would be really helpful.

Thanks,

@armaniferrante armaniferrante added the composition Changes needed for programs composing with the dex label Jun 23, 2021
@wdstudionft
Copy link

We need to solve this problem asap, I have 8 sol locked because create 2 wrong market.
https://github.com/Henry-E/serum-dex/tree/97f9596541bafa8bf3907693db28901c32241666

@h4rkl
Copy link

h4rkl commented Oct 20, 2022

Is this dead? Have a market I'd love to close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
composition Changes needed for programs composing with the dex priority:1
Projects
None yet
Development

No branches or pull requests

5 participants