metaDAOproject / meta-dao-frontend

https://app.themetadao.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Correct Use For Openbook-V2 Accounts / Structure - {X} META Bounty

canny opened this issue · comments

For each order we're creating a new account, whereas we have the capacity for up to 32 orders under the account. I also believe we can recycle orders where you really should only need to close the account at the end of the proposal period.

This should handle up to 32 orders then spin up another order account and handle the creation, settlement, edit and cancel of each order.

This is closely related to {Use Funds In Openbook-V2 Market Account For Placing Orders}.

https://the-meta-dao.canny.io/admin/board/ui-ux/p/correct-use-for-openbook-v2-accounts-structure-x-meta-bounty

This issue has been linked to a Canny post: Correct Use For Openbook-V2 Accounts / Structure - {X} META Bounty 🎉

These things are hardcoded to the first account included in the current UI:

if (order.account.openOrders[0].isFree === 0) {

Wherever we call to process these things I've hardcoded the 0th element as the remaining 23 have no value / aren't used, this would have to be expanded to accept up to the full 24 vs where we're just grabbing the one here (there's a few more places and likely some more tendrils where settling / closing and checking for partial fills is required to be changed).