Understanding Solana Jito transactions with Bundleonly = TRUE
When you send a single Jito transaction to the Solana blockchain, you are facing a common dilemma: how to combine your transactions together while ensuring their integrity and security. One way to achieve this is by using the ‘Bundleonlyparameter in Jito transactions.
In this article, we will deepen in the details of creating Jito transactions with only a package, focusing on what it means for them to be protected and mev (average exit time)-protected.
What are the Jito transactions?
Jito is a solar -specific transaction protocol that allows you to send multiple assets as a single transaction. It is especially useful when you need to transfer a small amount of one asset in exchange for another, while paying a tank on the net and leaving a margin for a potential profit (MEV).
What is Bundleonly = True?
WhenBundleonly = True, Solana will try to create a package of your transactions. This means that if you are sending multiple assets with different transaction identification numbers or gas prices, they will be combined in one package.
Here's an example of what a Jito pack transaction may look like:
Sol
Jito {
Entrance {
Address = “0x1234567890ABCDEF”
Gasprice = 1000000
Amount {
Assettype = “Token”
Tokenaddress = “0x9876543210FEDCBA”
Quantity = 10
}
}
Exit {
Address = “0xabcdef12345”
Gasprice = 10000
Amount {
Assettype = “Token”
Tokenaddress = “0x4567890123456789”
Quantity = 20
}
}
}
`
In this example, we created a Jito transaction with two input and output assets.
Recover protection
By default, Solana transactions are considered to be restorative. However, if you use the Bundleonly = True
parameter, your package transaction will be treated as non -refundable. This means that if one of the individual inputs fails or is rejected by the network, the entire transaction will be returned to its original state.
To mitigate this risk, you can activate the Revert protection of your transactions by using the RevertProtect
feature in JavaScript SDK of Solana.
`javascript
CONST JITO = Requirement (‘@Solana/Web3.js’). jito;
// Create a new Jito transaction with protection from Revert
const transaction = new jito ({{{
Entrance: [
{
Address: “0x1234567890abcdef”,
Gasprice: 1000000,
Sum: {
Assettype: “Token”,
Tokenaddress: ‘0x9876543210fedcba’,
Quantity: 10
}
},
{
Address: “0x4567890123456789”,
Gasprice: 10000,
Sum: {
Assettype: “Token”,
Tokenaddress: ‘0x7654321098765432’,
Quantity: 20
}
}
],
Output: [
{
Address: “0xabcdef12345”,
Gasprice: 10000,
Sum: {
Assettype: “Token”,
Tokenaddress: ‘0x901234567890abcdef’,
Quantity: 30
}
}
)
});
// Make the transaction
transaction.sign ();
`
Mev Protection
To further provide your package transactions, you can use the Mevprotect
feature to activate MEV protection. This will ensure that any potential profits from market fluctuations are protected.
Here’s an example of how to create a JITO MEV transaction protected:
`javascript
CONST JITO = Requirement (‘@Solana/Web3.js’).