Solana: Jito Transaction Bundle only with v2. Parameter?
=============================================== ==== ==============
Starting with Sola 1.13, you can serve more transactions in a single package, as long as certain conditions are. In this article, we will explore how to use the parameter Bundleonly = true when we send a transaction to Solana.
What is a jito transaction?
--------------------------
A jito transaction is an optimized type of transaction that allows effective and safe transfer on multiple accounts. It was introduced in Sola 1.8 as a substitute for the Old "Transfer" Function. A Jito Transaction Consists of Several Transactions, each with its own data set.
Package Transactions
--------------------
A package transaction is an optimized way to serve more transactions to a single transaction. This allows significant efficiency gains compared to sending individual transactions one after another.
Bundleonly Parameter
-----------------------
When sending a transaction as a package on Solana, you can specify the "Bundleonly” parameter with a “true” value. HERE’S AN EXAMPLE:
`Sol
Use Solar-Program :: Account_info;
// Create Two Account Information for the Sender and Receiver Accounts
To Sender_account_info = Account_info :: NEW (
“Sender” .to_string (),
0,
1, // The Accounting Account Index
);
to receive_account_info = account_info :: NEW (
“Receiver” .to_string (),
0,
1, // The Index of the Receiver Account
);
// Create a Jito Transaction With Bundleonly = True and Type
Either Jito_Transction = Solar_Program :: Transaction :: Builder :: NEW ()
.Set_account_info (sender_account_info)
.Set_account_info (Receiver_account_info)
.Set_tag (“jitotransction”)
.Set_tag (“Bundleonly = True”)
.with_packed_bytes (
Solana_program :: Package_array :: Array (
// add jito transactions as individual bytes
Solana_program :: Package_array :: NEW (
Account_info :: NEW (
“transactions1” .to_string (),
0,
1, // transaction index
),
Account_info :: NEW (
“Transaction2” .to_string (),
0,
1, // transaction index
)
),
)
);
// send the jito transaction as a package
Let result = solana_program :: Program :: Send_jito_transact (& Jito_transact);
`
MEV Protection
------------------
By default, Solar Transactions do not provide MEV Protection. However, you can activate the MEV protection for the Jito Transaction by Adding theMEV_Protection Parameter = Trueto the Transaction Data:
Sol
Either Jito_Transction = Solar_Program :: Transaction :: Builder :: NEW ()
.Set_account_info (sender_account_info)
.Set_account_info (Receiver_account_info)
.Set_tag (“jitotransction”)
.Set_tag (“Bundleonly = True”)
.with_packed_bytes (
Solana_program :: Package_array :: Array (
// add jito transactions as individual bytes
Solana_program :: Package_array :: NEW (
Account_info :: NEW (
“transactions1” .to_string (),
0,
1, // transaction index
),
Account_info :: NEW (
“Transaction2” .to_string (),
0,
1, // transaction index
)
),
// add bytes of protective mev
Solana_program :: Package_array :: NEW (
Account_info :: NEW (
“MEV_Protection_bytes”.