Never Getting Sandwiched Again on Solana
Disclaimer
This report is made in collaboration with Kamino and is therefore sponsored. All editorial decisions, opinions, and conclusions expressed are entirely those of our own and remain independent of any external influence.
Abstraction and improvements in user experience have drastically accelerated economic activity on Solana’s various decentralized exchanges. Lightning fast transaction confirmations, coupled with minuscule fees allow these trading venues to facilitate tremendous amounts of trading volume. Sensing opportunity from the increased motion, sophisticated actors have sneakily set up shop in the shadows to capitalize on hordes of unsuspecting traders and certain protocol mechanisms.
Introduction
The crypto industry as a whole has undoubtedly progressed significantly as liquidity that used to be confined to centralized exchange hot wallets is venturing on-chain at remarkable rates year over year. Permissionless markets featuring lesser known assets, deep liquidity and simple to use interfaces are one of the key catalysts driving this migration event. Nowadays, token swaps can be settled in a few clicks and require little to no knowledge about the underlying technology despite its complexity and incomprehensiveness to most.
This knowledge barrier, the unique design characteristics of different blockchains, in addition to still developing infrastructure–present lucrative prospects to those knowledgeable enough to grasp and subsequently implement these complicated concepts for their own gain at the detriment of others. As ecosystems mature and become increasingly competitive, skilled participants are exhausting additional effort and resources to deploy creative strategies beyond the firmament, out of sight for the average user.
Though it might sound disheartening, the aforementioned tactics aren’t novel and have long been a pain point for builders in the space. Fortunately there are measures being put into place on multiple fronts to circumvent these antics on Solana, of which this article will highlight Kamino’s approach in particular.
The Hidden Hand
Rather than skipping to the solution, let's first identify the issue in greater detail and discuss how it’s enabled. At its core, it’s simply a game of incentives. Validators upholding the integrity of the network are financially motivated to produce blocks containing transactions that yield the highest amount of rewards. Being granted total authority over the contents over an assigned block allows reordering, adding or removing transactions.
Any value derived from these actions is referred to as maximal extractable value (MEV), a practice commonly associated with Ethereum, but becoming increasingly prevalent on Solana in recent months.
Individuals competing for blockspace can effectively bribe validators by outbidding others, offering higher fees to secure a desired transaction order or ensure quicker inclusion of their transactions in the block. This incentive structure paves the way for several convoluted value extraction techniques highly dependent on precise timing and specific conditions in order to have a positive expected return.
- Arbitrage;
- Front-running;
- Front- & back-running (Sandwich Attack);
In most cases, these processes are automated and executed algorithmically with the help of searchers that continuously scan the state of the chain, as the window of opportunity is typically present for only one to two blocks at any given time.
It’s important to note that not all MEV activity is inherently harmful; arbitrage, for instance, naturally improves market efficiency by eliminating price discrepancies across multiple venues. However, the same can’t be said about sandwiching, a predatory application of MEV, solely benefiting searchers and validators. By meticulously placing large buy orders ahead of a targeted actor within a block to temporarily inflate the execution price within the victim’s slippage tolerance, the searcher then follows up with a sell order to profit from the artificially induced price increase.
Evidently slippage configurations act as the attack vector in this scenario and could, in theory, be mitigated by adjusting the values to a more conservative percentage. While this notion holds some merit for highly liquid assets, a significant portion of the actively traded market (e.g. memecoins with thinner liquidity) remains vulnerable due to greater price impact and the ambiguous slippage thresholds required for successful execution.
The negative repercussions of this for the end user and application developers are quite significant as it leads to orders being filled at the upper bounds of their slippage tolerance, resulting in less favorable trade outcomes and diminished value. This not only impacts the immediate trading experience but also erodes confidence in the ecosystem, potentially discouraging future participation, in addition to jeopardizing critical protocol-level operations, such as liquidations on lending markets, traditionally reliant on decentralized exchanges.
Two-for-one Special
Recognizing the interrelated pitfalls prefaced in previous segments and existing infrastructure shortcomings, Kamino embarked on a mission to devise an in-house, intents-based (limit order) exchange platform, built on three guiding principles: zero slippage, zero MEV and zero protocol fees. Initially conceived to complement the proprietary liquidation engine, the team soon realized the broader implications of their ambitions. Democratizing access to this product through a public-facing interface, enables them to address not just the needs of internal operations, but also provide a transformative alternative to on-chain trading.
Leveraging Pyth's vast network of searchers, composed of well-funded, established institutional firms, ensures optimal price execution for token swaps, irregardless of size, local market volatility or blockchain congestion through immensely competitive auctions settled far outside the reach of MEV actors.
Liquidator Empowerment
Neutralizing the risk of abuse while streamlining liquidator onboarding and improving capital efficiency allows Kamino to take back control of incentive alignment, fairly rewarding contributors providing genuine value to the protocol.
Liquidators, vital to maintaining market stability, will soon be able to frictionlessly participate in optimized liquidation auctions, unconstrained by current exchange and aggregator integrations exposing them to fees, MEV and slippage, resulting in reduced profitability.
Borrowers, in turn, benefit from minimized losses on forced position closures, as the enhanced liquidation process ensures that their positions are closed at more favorable prices. This aspect is especially relevant for larger, riskier loans, which are typically prone to liquidity challenges.
The upcoming implementation is crucial in fostering intra-market dynamics that prioritize value creation and preservation over exploitation, ultimately bolstering protocol safety and promoting more equitable outcomes for all participants.
Trade More for Less
Although the limit order functionality is still in beta and subject to ongoing refinement, yet to be officially introduced to the lending arm and other leverage products, it is, however, accessible for traders at this very moment on Kamino Swap.
Beyond the advantages brought forth by the eradication of MEV, the system introduces searcher tips, where solvers compete to fulfill trades by delivering additional value directly to the trade initiator. Furthermore, any surpluses generated from arbitraging during the auction process are returned to the user, enabling traders to occasionally receive more tokens than originally requested. With these features in place, traders are guaranteed to receive exactly what they're expecting, and possibly more.
Despite being limited to the SOL-USDC pair for now, a great deal of value has already been generated from processing ~$23.07 million of trading volume across 10,189 orders.
While the figures may appear negligible at first glance, the long-term savings become substantially more impactful when factoring in the added fees and miscellaneous costs that would otherwise be incurred when transacting through other platforms. These cumulative savings highlight the system's efficiency and user-centric design. It's very likely that these numbers will continue to grow rapidly as new asset pairs are listed and a market order feature, akin to that of CoWSwap, is integrated into the trading suite down the road.
Conclusion
MEV, a feature rather than a bug in some aspects, remains an inherent challenge in deFi. However, its detrimental effects on users and applications can be effectively mitigated by incorporating external transaction rails, which help prevent unwanted value extraction and unpredictable behavior in certain use cases. By adopting such solutions, platforms like Kamino can create a more secure, efficient and reliable environment , void of value leakage. These advancements are not only desirable but critical to ensuring the robustness, viability and longevity of on-chain financial products.
Disclaimer
The information provided is for general informational purposes only and does not constitute financial, investment, or legal advice. The content is based on sources believed to be reliable, but its accuracy, completeness, and timeliness cannot be guaranteed. Any reliance you place on the information in this document is at your own risk. On Chain Times may contain forward-looking statements that involve risks and uncertainties. Actual results may differ materially from those expressed or implied in such statements. The authors may or may not own positions in the assets or securities mentioned herein. They reserve the right to buy or sell any asset or security discussed at any time without notice. It is essential to consult with a qualified financial advisor or other professional to understand the risks and suitability of any investment decisions you may make. You are solely responsible for conducting your research and due diligence before making any investment choices. Past performance is not indicative of future results. The authors disclaim any liability for any direct, indirect, or consequential loss or damage arising from the use of this document or its content. By accessing On Chain Times, you agree to the terms of this disclaimer.