metaDAOproject / meta-dao-frontend

https://app.themetadao.org
Other
16 stars 16 forks source link

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

Open canny[bot] opened 4 months ago

canny[bot] commented 4 months ago

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

canny[bot] commented 4 months ago

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

R-K-H commented 4 months ago

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

https://github.com/metaDAOproject/meta-dao-frontend/blob/a8c7f14a371fbc16a8cc399366d61ff3978d7361/lib/openbook.ts#L253

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).