The process for shutting the down the market is as follows
Each proposal has two markets
Find all the open order accounts on a particular market
For each open order account
call prune orders
call settle funds expired
A given open orders may not have orders to prune or funds to settle but best to call the functions anyway. If you want to be fancy you can check the account data and decide if it's necessary.
Once all the open orders accounts have been settled
So we'll only have this for v0.2 ONE market, we will circle back on this depending on the future state, but going to append this to the FaaS board to ensure we've got coverage in the upcoming week.
Openbook-TWAP supports three new instructions, see all the PRs linked here https://hackmd.io/@HenryE/Bkvk6eG10#Openbook-TWAP
The process for shutting the down the market is as follows
You can see the flow here in the tests. Though it's easier in the tests because we already know all of the open order account pubkeys. https://github.com/metaDAOproject/openbook-twap/blob/develop/tests/openbook-twap.ts#L428-L529