Solana's Triangular Arbitrage Explored: A Case Study on Jito
From Transaction Details to Profit Calculations: Unraveling Solana's Arbitrage Mechanisms
This analysis explores the relationship between two arbitrage transactions and their signals on Solana. Key observations are:
On the Solana blockchain, there isn't always a strong binding relationship between transactions and signals. Bots frequently issue transactions at a high frequency to capture arbitrage opportunities.
Built-in computation might possibly execute arbitrage.
How triangle arbitrage is executed can be found here: Transaction Details on Solscan
Triangular Arbitrage Process
187.48 SOL -> 17533.99 USDC
17533.99 USDC -> 905000000 Bonk (with change amounting to 5.0419 + 0.011969 USDC)
905000000 Bonk -> 1382.26 SOL
Profit and Loss Calculation
Revenue: 1382.26 SOL - 187.48 SOL = 1194.78 SOL
Cost: 1099.190005 SOL (paid to Jito & Validator)
MEV tip: 1099.19 SOL
Gas Fee: 0.000005 SOL
Profit: 95.59 SOL
CRR: 92%
Affiliated Transactions Analysis
This section explores two transactions within Solana block 237321932, examining their interrelation and their roles in executing a triangular arbitrage strategy.
Context
All transactions observed in slot 237321932 were scrutinized, highlighting the transactions before and after a specific trade. Notably, a Solana block often contains a significant number of Vote transactions. The count of non-vote tx is frequently used to measure the activity level on the Solana chain.
Transactions appearing later in the block tend to have a higher failure rate but incur very low transaction fees, characteristic of a high-frequency trading market.
Transaction Analysis
Transactions in the yellow box: The transaction highlighted in yellow is the first arbitrage transaction in the block. The absence of preceding signal transactions suggests it might be conducting a strategy that doesn't require binding with signal transactions.
Transactions in the red box: The red box marks the arbitrage transaction and its signal transaction analyzed in this article. Further investigation reveals that these two transactions have different recent_block_hashes, indicating that their initiators referenced block hashes from distinct moments to anchor time.
According to Solana's documentation, hashes from within the last 151 slots can be used; any older ones are discarded.
Reference: Solana Documentation
A Flipside query of the block hashes corresponding to slots shows that the arbitrage transaction analyzed referenced recent_block_hash 237321866, which is 66 blocks prior.
However, the signal transaction used recent_block_hash 237321919, 13 blocks prior. This implies that the arbitrage transaction might have waited for about 53 blocks (400-600ms/block) for a signal to be packed.
Assuming the searcher acts upon seeing the signal and sends a bundle, it would take no more than 6 seconds for this bundle to be processed onto the chain.
Signal Transaction
The second transaction before the arbitrage trade was executed in the same Raydium Liquidity Pool, involving a large SOL to Bonk exchange: Transaction Details on Solscan
Input data
In Solana, a transaction's instructions are primarily composed of instruction elements. The state is directly retrieved from the token holder address using the Address Lookup feature, and the DEX contract itself does not record state information.
In this arbitrage transaction, the searcher (signature address) is D7K7GCCY76z15Za4hkRBPw7hwKfQXqKSobQFeaiL2Zu, and the Bot contract address is GzxwDvhbNcKTt4LBez3k9CuKZfuq5N3mZKYkBTKn1nKX.
A total of six sets of instructions, numbered from 0 to 5, were executed:
Instructions 0 and 1 involve the Searcher calling the Bot contract. The Instruction Data is extremely brief but specifies account addresses. Except for the System Program, which is an official address, the other addresses are owned by the Searcher.
Instruction 2 is related to the expenditure of the gas fee.
Instruction 3 is the primary arbitrage instruction. The instruction data here is to be analyzed.
Analysis of Swap at Whirlpool Input
f8c69e91e17587c8
28bb0fa72b000000 # 2ba70fbb28 = 187486419752 = Amount
0000000000000000 # OtherAmountThreshold
503b0100010000000000000000000000 # 0100013b50 = 4295048016 = SqrtPriceLimit
01 # AmountSpecifiedIsInput
01 # AToB
The list includes 56 addresses pending balance status lookup, each correlating with subsequent arbitrage swap operations. For instance, the first step involves a swap between SOL and USDC on Orca, comprising one swap and two token transfer actions.
It's important to note that the Bot contract directly calls the DEX contract. The overlap between the parameters passed from the Bot contract to the DEX contract and those from the Searcher to the Bot contract can inform us about the presence or absence of built-in computation.
First Arbitrage Without a Preceding Signal
The instruction data '0c00' in the main arbitrage instruction strongly suggests that the operation likely did not involve external parameters.
Wrapping Up the Intricacies of Arbitrage on Solana
In conclusion, this detailed analysis discloses intricate details about the arbitrage transactions and their signals on Solana. It not only sheds light on the transaction evaluation process but also provides insight into the complexity of the triangular arbitrage strategy. From the dissection of block 237321932 to transaction instructions to the entire arbitrage process, we find several instances of low latency and high-frequency trading techniques, such as built-in computation and direct calling of DEX contracts. We also emphasize that transactions in the Solana ecosystem are not always strongly bound with signals and may operate independently as per their strategic requirements. The study of specific cases, such as the initial arbitrage without a preceding signal, further enhances this understanding. Therefore, understanding these mechanisms can provide actionable insights into the Solana ecosystem and help to devise more efficient strategies in the future.
Visit DeFi Strategies Case Studies by EigenPhi or bit.ly/head-first-defi to learn more trading tactic analyses.
Follow us via these to dig more hidden wisdom of DeFi:
EigenTx | Website | Discord | Twitter | YouTube | Substack | Medium | Telegram