As an early XRP holder and now a developer, I've seen the XRPL ecosystem evolve. Alongside two friends, I founded CalorieToken to create a real use case for tokens on the XRPL. Our journey led us to confront a significant issue: frontrunning on the XRPL order books. This blog post outlines our solution to this problem. During our development phase, we noticed an issue when one of my friends heavily traded EQ for XRP. Despite his efforts to accumulate more XRP, he ended up with less XRP and more EQ. He then sent his EQ to Bitrue for staking, aiming to earn some APY. However, his EQ sell orders remained open on the XRPL, even though his EQ was no longer in his XRPL wallet. This anomaly, known as negative spread, raised concerns about the integrity of the XRPL trading environment. Frontrunning involves exploiting the time gap between when a trade is initiated and when it is executed. A frontrunner can place their orders ahead of others to profit from price movements. On the XRPL, unfunded offers exacerbate this issue: This practice undermines the fairness and transparency of the trading environment, making it crucial to address unfunded offers on the XRPL. At the Apex 2023 conference in Amsterdam, I attended Vito Tumas' keynote on frontrunning on the XRPL. After the session, I proposed a solution: preventing orders from remaining open without the necessary funds. Vito's interest in this idea encouraged me to pursue it further. https://youtu.be/9GNe13zGrvA?si=MFbcn_DLheWLgBWV I also shared my thoughts with David Schwartz, suggesting the need to cancel unfunded offers. David highlighted the XRPL's resource constraints, explaining that continuously checking for unfunded offers would be too resource-intensive. His feedback, while sobering, pushed me to think outside the box for a more efficient solution. Determined to resolve the issue without compromising the XRPL's performance, I collaborated with other developers and devised a novel approach: Implementing this solution underscores our commitment to maintaining a transparent and reliable environment for CalorieToken and the broader XRPL community. While David Schwartz suggested relying on third-party software, our oracle-based approach offers a direct and efficient method to tackle unfunded offers, enhancing the overall integrity of the XRPL. Our journey from identifying a problem to proposing a viable solution reflects our dedication to the XRPL ecosystem. By addressing the issue of unfunded offers, we aim to contribute to a more secure and efficient trading environment. Stay tuned as we continue to develop and refine our solutions for the betterment of the XRPL community.Tackling Frontrunning on the XRPL: Our Journey to a Practical Solution
Introduction
The Problem: Unfunded Orders and Negative Spread
Understanding Frontrunning and Unfunded Offers
Apex 2023: A Keynote that Sparked an Idea
Discussing with David Schwartz
Crafting a Resource-Efficient Solution
Why This Solution Works
A Step Towards a Cleaner XRPL
Conclusion
Calorie aims to be the world’s food token