3

I run a small exchange and I have 1000s of solana addresses to monitor for incoming transactions. What is the best way to monitor this many addresses and programmatically run a script when it detects something?

1 Answer 1

2

The best way would be to ask your customers to use your app to send funds to the exchange (or perform a swap). That way, you can do all that needs to be done within your app, and you don't have to "monitor" a lot of accounts.

If you cannot do that (think hard if you REALLY cannot do that), then you would have to poll the accounts, i.e. periodically fetch the account contents and see if anything has changed.

Every fetch is an RPC call, and RPC nodes usually have rate limits. You don't want to spam the RPC node. I think for exchanges, polling once per second, or even once every 10 seconds should suffice.

However, things multiply if you have thousands of accounts to monitor.

I see some exchanges that ask you to "register" and upcoming deposit, and the address it will be coming from.

That way, all can send to one and the same account, you need to monitor only that one account, and then check the source and attribute the deposit to the corresponding customer.

2
  • what if I run my own node to query from? i definitely don't want to dedicate 1TB+ to download the solana blockchain, but maybe just fetch max 1gb of history and then I can poll against that? Aug 13, 2022 at 16:22
  • Yes, on your own node, you're free to store as much or as little history as you want, both for the ledger and the log. Aug 13, 2022 at 16:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.