Skip to content

feat: create an instruction to reclaim the rent of limit order seats if the market has been deleted - #53

Open
jarry-xiao wants to merge 7 commits into
masterfrom
phoenix-v1/delete-seat-instruction
Open

feat: create an instruction to reclaim the rent of limit order seats if the market has been deleted#53
jarry-xiao wants to merge 7 commits into
masterfrom
phoenix-v1/delete-seat-instruction

Conversation

@jarry-xiao

Copy link
Copy Markdown
Contributor

The changes here are extremely small, all hand-written:

  • Adds the funding key to the Seat account on creation. This allows rent to be reclaimed to the correct destination
  • Adds a new instruction to reclaim the Seat's lamports to the correct funder
    • For legacy, if the funder is the system program, return to the trader
    • The seat's data is checked against the market key.
    • If the market's data is empty, the seat can safely be reclaimed
      • Note that there is an edge case where the previous Market Authority can intentionally cause UB here if they held on to the private key. This PR explicitly rejects seat cleanup in this case.

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 this pull request may close these issues.

1 participant