Solana: Jito transaction with bundleOnly=true parameter?

Understanding Solana Jito Transactions with BundleOnly=True

When sending a single Jito transaction to the Solana blockchain, you are faced with a common dilemma: how to bundle transactions while ensuring their integrity and security. One way to achieve this is to use the bundleOnly parameter in Jito transactions.

In this article, we will go into detail about creating Jito transactions using only a true bundle, focusing on what rollback protection and MEV (Mean Time to Exit) protection mean for them.

What are Jito Transactions?

Jito is a Solana-specific transaction protocol that allows you to send multiple funds in a single transaction. This is especially useful when you need to exchange a small amount of one asset for another, while paying a tip to the network and leaving a margin for potential profit (MEV).

What is bundleOnly=True?

If bundleOnly=True, Solana will attempt to create a bundle from your transactions. This means that if you send multiple funds with different transaction IDs or fuel prices, they will be combined into one package.

Here is an example of what a bulk Jito transaction might look like:

Seed {

input {

address = "0x1234567890abcdef"

Gas price = 1000000

amount {

assetType = "token"

Token address = "0x9876543210fedcba"

quantity = 10

}

}

Output {

address = "0xabcdef12345"

Gas price = 10000

amount {

assetType = "token"

Token address = "0x4567890123456789"

quantity = 20

}

}

}

In this example, we created one Jito transaction with two input and output assets.

Revert Protection

By default, Solana transactions are considered reversible. However, if you use the bundleOnly=True parameter, the bundle transaction is considered irreversible. This means that if any entry fails or is rejected by the network, the entire transaction is rolled back to its original state.

To mitigate this risk, you can enable transaction rollback protection using the revertProtect function in the Solana JavaScript SDK.

const Jito = require('@solana/web3.js').Jito;

// Create a new Jito transaction with rollback protection

const transaction = new Jito({

input: [

{

address: "0x1234567890abcdef",

Gas price: 1000000,

amount: {

assetType: 'token',

Token address: '0x9876543210fedcba',

quantity: 10

}

},

{

address: "0x4567890123456789",

Gas price: 10000,

amount: {

assetType: 'token',

Token address: '0x7654321098765432',

quantity: 20

}

}

],

Output: [

{

address: "0xabcdef12345",

Gas price: 10000,

amount: {

assetType: 'token',

token address: '0x901234567890abcdef',

quantity: 30

}

}

]

});

// Submit transaction

transaction.char();

MEV protection

To further secure your bulk transactions, you can use the mevProtect function, which enables MEV protection. This way, all potential profits will be protected from market fluctuations.

Here is an example of how to create a Jito transaction protected with MeV amount:

“`javascript

const Jito = require(‘@solana/web3.js’).

Leave a Comment

Your email address will not be published. Required fields are marked *