Report: Stress Testing SundaeSwap’s New Smart Contracts on Cardano Testnet
Introduction
As part of SundaeSwap’s commitment to ensuring the highest standards of performance and reliability in our decentralized exchange, we conducted an extensive stress test on Sundae v3 using Cardano’s preview testnet. This testing was aimed at evaluating the performance of our newly implemented smart contracts under sustained and high load conditions.
Test Overview
The primary focus of this stress test was a soak test that ran continuously for 72 hours. During this period, we simulated a high-traffic environment by placing 25 orders per transaction on the blockchain. This approach was designed to mimic and exceed normal operating conditions, ensuring that our systems can handle peak loads without compromising on performance.
Execution and Findings
Throughout the test period, which ran from January 27th through January 30th, our systems processed transactions at rates varying between 20,000 and 60,000 transactions per day. This performance is notably higher than the all-time peak across all decentralized exchanges (DEXs) on Cardano, which recorded 25,000 to 30,000 transactions in a single day. The total volume of transactions processed during the testing phase reached approximately 233,000 transactions across several weeks.
You can see many examples of these high-throughput transactions by browsing the transactions at this wallet address.
In practice, while we placed 25 orders per batch, we found that our contracts peak out closer to 35 orders per batch, depending on the conditions. Here is an example of a swap with 34 orders in a single batch.
For others looking to load test your protocols in a similar way, we wanted to share these important insights:
- It’s important to actually test your contracts on chain; The performance reported by a single unit test, compared to the overhead of a real transaction on chain, gave very different pictures of our performance.
- It is important to test under varied conditions. We made sure to test a mixture of swaps in both directions, deposits, and withdrawals.
- It would be helpful to deploy a version of the protocol that charges lower (or zero) fees; we ended up spending hundreds of thousands of tADA on these load tests!
- To ensure you keep up with and stress-test your protocol, you can leverage the UTXO model, and place many orders in the same transaction. This allows one on-chain transaction to generate an outsized amount of work to stress the protocol.
The high transaction throughput demonstrates the robustness and scalability of our new smart contracts. The ability to maintain consistent performance at these levels underscores our platform’s readiness for high-volume trading scenarios.
Conclusion
The results from this stress test are highly encouraging. They not only demonstrate SundaeSwap v3’s capacity to handle significantly higher transaction volumes than currently observed on Cardano but also assure our community and stakeholders of the platform’s stability and efficiency.
Moving forward, we will continue to refine and optimize our systems. The insights gained from this stress test are invaluable and will guide further enhancements to ensure SundaeSwap remains at the forefront of innovation in the DeFi space. We are committed to providing a secure, efficient, and user-friendly trading experience to all our users.