Dodecahedr0x/meta-dao-frontend

[feature] stop creating so many order accounts

Opened this issue · 2 comments

Right now, we create one open order account per transaction. Really, a user only needs multiple when they have more than 24 orders outstanding. We should pull the user's single open order account and use that

R-K-H commented

If the account is open, you can continue to use the account correct? You just have to expand the account count if you need more that 24 orders? Or is it once an order has been filled that account's account is now invalid to place a new order from?

R-K-H commented

For the future person working on this issue..

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

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