1

I was trying to create a bot that each block will buy a given token, but when i try to send bunch of transactions with 30ms break in-between I can see that my transactions arent happening each block but every couple of blocks, despite being sent faster than block.

For instance, I sent 100 transactions one after another for a few seconds and I got in with 10 of them in blocks:

244276553, 244276548, 244276543, 244276540, 244276537 

And clearly transactions are spaced by at least 3 blocks in between.

I'm using my own full node RPC that I set up today. Is there anything that I can do to make it work every block?

3
  • How much contention is there between your transactions, and specifically are you buying/selling to the same accounts?
    – Callum M
    Commented Jan 27 at 10:48
  • @CallumM What is contention? And yes there is one wallet that is performing buying/selling.
    – Kacper
    Commented Jan 29 at 17:04
  • Could you post the code to send the transactions? Maybe you are actually confirming the transactions befor you send the next one?
    – Jonas H.
    Commented Jan 30 at 13:23

2 Answers 2

1

The person who ultimately determines what transaction gets included in what block is the leader. This means that running your own full-node ensures that your transactions get included when you are the leader (unless other validators purposely collude to vote against it, but this is extremely unlikely). However, when other nodes are the leader, you have no guarantee, as blocks are limited in size and Compute Budget, so not every transaction can be included. You can significantly increase the probability of your transaction being included by setting higher priority fees and/or using Jito bundles, however I don't think there's a way to guarantee a transaction inclusion in every block with 100% certainty.

3
  • Thank you for your answer, but I still don't quite understand why my transactions with high priority fee don't get included. For instance there is this wallet which transactions happen nearly every block, yet mine happen every couple of blocks. And from what I see he is paying 10x smaller fees than I am for my failed transaction. Also regarding Jito bundles, how often do they happen? Is the MEV market in Solana as big as in ETH? I've seen their MEV Dashboard but I am not sure if it's that big of a deal here.
    – Kacper
    Commented Jan 29 at 17:03
  • I'm not as familiar with ETH as Solana so I can't answer how the MEV market compares, but most arbitrage bots make use Jito to ensure their transactions get included. As for the wallet you linked, I don't know if they use Jito themselves, however I can see that they spam an absolutely enormous amount of transactions, (most of which fail) to get their tx included which is costing them a lot in fees. For them Jito would probably be cheaper, as this is the whole reason it was invented.
    – McBain
    Commented Jan 29 at 18:08
  • Additionally, priority fees depend on how contested the state you're trying to access is. So if I'm trying to get a tx included that swaps two random memecoins, I can get included for a lower priority fee than you if you're trying to swap SOL and USDC for example, as the accounts controlling that market are likely in more demand. I didn't take a super close look at the wallet you linked, but they're probably also accessing state that is less contested than the one you're trying to access.
    – McBain
    Commented Jan 29 at 18:09
1

If you want to land more transactions, here are a few things to keep in mind.

  • It's totally normal that you don't land a transaction in every block. Some of those blocks might not even exist because of a delinquent validator.
  • If you're sleeping 30ms between each transaction, then you can an only get ~13 transactions in a block max, since blocks are timed to be roughly 400ms. Try only sleeping 10ms to get more transactions in.
  • If your RPC node is unstaked or doesn't have an agreement with validators, it might not be much more performant that just using a TpuClient from a normal client machine to send transactions at the network. See how many transactions you can land using something like send_and_confirm_transactions_in_parallel https://github.com/solana-labs/solana/blob/d5ab2fa1df07203387a13e98ad94fa4bb5aee053/client/src/send_and_confirm_transactions_in_parallel.rs#L393
2
  • How can I get an agreement with validators? I've heard about them many times. but didn't find anything about it. what it is ? how it works. thanks
    – slntrx
    Commented May 6 at 11:10
  • 1
    You'll need to reach out to specific validators to implement stake-weighted quality of service (swqos), where they list your RPC node as having more stake, thereby giving you more connections to their node, which in turn has more connections to the rest of the network. solana.com/developers/guides/advanced/stake-weighted-qos has more info, but I can't tell you how to make an agreement with a validator
    – Jon C
    Commented May 6 at 11: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.