Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

market.findOpenOrdersAccountsForOwner() irregular results. #173

Open
Gsuz opened this issue Sep 25, 2021 · 1 comment
Open

market.findOpenOrdersAccountsForOwner() irregular results. #173

Gsuz opened this issue Sep 25, 2021 · 1 comment

Comments

@Gsuz
Copy link

Gsuz commented Sep 25, 2021

the function market.findOpenOrdersAccountsForOwner() seems to be unreliable as it some times does not include all the accounts. For example the below code gave the following result:

  async function getOpenOrderAccounts() {
      
    let openOrderAccounts = await market.findOpenOrdersAccountsForOwner(
        connection,
        owner.publicKey,
      )
      console.log(openOrderAccounts.length)
      for (let index = 0; index < openOrderAccounts.length; index++) {
          const element = openOrderAccounts[index];
          //console.log(element.address.toString())
          if (element.address.toString() == openOrdersAccountAddress){
              console.log('found our account')
              for (let index2 = 0; index2 < element.orders.length; index2++) {
                  const element2 = element.orders[index2];
                  if (element2.toString() !== '0') {console.log(element2.toString())}           
              }
          }
      }
  }

$ node test.js
95
found our account
5755384150997379837575
5755384150997379837573
5755384150997379837572
5755384150997379837571
$ node test.js
94
$ % node test.js
94
$ % node test.js
94
$ % node test.js
94
$ % node test.js
95
found our account
5755384150997379837575
5755384150997379837573
5755384150997379837572
5755384150997379837571

@Gsuz
Copy link
Author

Gsuz commented Sep 25, 2021

Could this be the result of me being throttled?

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

No branches or pull requests

1 participant