Search code examples
rpcsolanaserum-dex

connection.getProgramAccounts disabled for certain clusters on Solana?


The RPC call, connection.getProgramAccounts() seems to be working for my local validator and a locally deployed program, but it shows the following error when I'm trying to fetch program accounts for Serum Dex V3, 9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin.

error: {code: 410, message: "The RPC call or parameters have been disabled."}
code: 410
message: "The RPC call or parameters have been disabled."
id: "f4ea7d5f-5ff4-4707-a88d-94231f7c1698"
jsonrpc: "2.0"

Am I doing something wrong, or is this expected behaviour?s


Solution

  • This is unfortunately normal behavior. Because of the large number of accounts that need to be sent back, RPC nodes typically restrict the use of getProgramAccounts, or the whole node can fall behind. You have a few options: