Tenderly's Optimistic Rollup Network Report is live! 🎉 Explore how optimistic rollups help scale Ethereum ecosystem!

Case Study

How Instadapp Created Dapp Simulation Mode to Build Trust and Confidence in DeFi

Organization: Instadapp

Website: instadapp.io

Industry: Decentralized Finance

How Instadapp Created Dapp Simulation Mode to Build Trust and Confidence in DeFi

"The Simulation API allows us to provide a better UX/UI experience to our users without creating an environment on a particular testnet. Our users can easily test transactions against real Mainnet data, see swap rates, and what their yield looks like before spending any money. Only when the Simulator is turned off is the transaction sent on-chain."

Thrilok Kumar

Head of Product at Instadapp

Founded in 2018, Instadapp is a DeFi platform that allows users to deposit, withdraw, and trade crypto assets across multiple protocols such as Aave, Uniswap, MakerDAO, and Compound. With more than 40,000 users and over $2 billion TVL, Instadapp is 100% trustless and provides developers with infrastructure for building reliable and secure DeFi solutions.

Operating in a nascent space, Instadapp’s core business mission involves helping users build confidence and trust in DeFi. For this reason, the Instadapp team implemented a simulation mode into their dapp, enabling users to test-run transactions and strategies against real Mainnet data without spending real money.

Bringing DeFi closer to newbies and OGs alike

The Instadapp platform allows both Web3 newcomers and experienced DeFi strategists to interact with different protocols across multiple networks. When using the platform, Instadapp users create DeFi Smart Accounts (DSAs) interactable from their EOA or MetaMask addresses. DSAs allow users to interact with different protocols with security and composability.

What lies behind users’ DSAs is a complex infrastructure of protocol connectors i.e. money legos. By combining these legos, Instadapp brings users a range of DeFi strategies and ensures cross-protocol interoperability. It also allows Web3 developers building on top of DSAs to add new connectors and start using them immediately to create new DeFi strategies.

Building confidence and trust in DeFi with simulations

Given the complexity of DeFi, Instadapp wanted to provide a seamless experience to users on their platform. For this reason, Instadapp wanted to enable their users to get familiar with their platform, simulate transactions, and test DeFi strategies before committing anything on-chain.

So, the Instadapp team integrated the Tenderly Simulation Infrastructure into their product.  This allowed them to strengthen confidence in DeFi trading and bring down the barriers to entry for more skeptical crypto traders. As Shriya Tyagi, a Solidity developer at Instadapp, describes, she was distrustful of crypto trading until she discovered Instadapp.

“When I was starting out with trading, I was very distrustful of certain platforms. When I started with Instadapp’s dashboard, which allowed me to simulate transitions prior to sending them on-chain, this really helped me build trust. We at Instadapp give users a trust factor. The trust factor definitely helps us get more volume and interactions on our platform.”

Using dapp simulation mode in production

To provide users with security and confidence when using their platform, the Instadapp team created a dapp simulation mode. This allows Instadapp to run the entire platform on a Mainnet-based testing environment powered by a Tenderly Fork. The dapp simulation mode also enabled them to remove the uncertainty and unreliability of testnets from their business model.

0:00
/
How to top up balances & simulate trades on Instadapp

The Instadapp development team exposes this simulation mode to their users. When Instadapp’s users initiate transaction simulations, a Tenderly Fork with 100 test ETH is deployed in the background, allowing them to run simulations or test complex investment strategies against Mainnet data. These infrastructure operations are entirely abstracted away from Instadapp’s users, ensuring a smooth user experience.

This allows users to get familiar with the platform, try out its functionalities, and play around with DeFi strategies in a safe, risk-free environment. For instance, users can test out different staking strategies. They can simulate what their end positions would look like and preview how much yield they’ll get.

So, with the dapp simulation mode, Instadapp users can:

  • Spin up a Fork in the background and get an account with 100 test ETH, with the ability to top up their balances.
  • Explore the available features without spending real money.
  • Test out different DeFi strategies, including end positions and earned APY.
  • Save funds by avoiding unfavorable or failing transactions.
  • Inspect unsuccessful transaction simulations in detail on Tenderly.
  • Turn off the dapp simulation mode and continue transacting with confidence.
0:00
/
How to simulate DeFi strategies on instadapp

As Thrilok Kumar, head of product at Instadapp, further explains:

“The Simulation API allows us to provide a better UX/UI experience to our users without creating an environment on a particular testnet. Our users can easily test transactions against real Mainnet data, see swap rates, and what their yield looks like before spending any money. Only when the Simulator is turned off is the transaction sent on-chain.”

Using simulations in issue resolution and internal testing

The Instadapp team also needed an efficient way to resolve potential issues and test any product upgrades or protocol integrations prior to implementation. So, aside from creating a dapp simulation mode, the Instadapp development team also uses Tenderly simulations in their internal processes too.

In a local environment, Web3 developers are restricted to seeing exactly how their contracts behave, without insight into any dependencies on external contracts. To identify them, developers need to deploy their contracts, see whether there are any reverts and at which specific addresses, and then go to Etherscan to further analyze them.

Instead of this process, Thrilok Kumar advises fellow developers to use Tenderly simulations to better understand contract execution while still in local development. If their contracts have external dependencies, they don’t need to deploy them to understand their interactions.

Instead, Web3 developers can push transactions to Tenderly directly from their local environments using the Tenderly CLI. Then, they can further simulate, inspect, and debug transactions without deployment to an actual network. This way, they can gain a better understanding of those external dependencies and identify potential issues early on.

With the Tenderly Simulation Infrastructure, the Instadapp team can run tests to ensure the integrity and security of their smart contracts.

Issue resolution for bugs and errors

Whenever a bug or error happens on their platform, simulations run automatically. If a simulation is unsuccessful, their alert processing system logs it in a dedicated channel. The Instadapp team then resolves these issues with a deep understanding of their root causes. Thrilok Kumar further explains:

“We use the Tenderly Simulator and Forks in production and internal testing. Whenever an error pops up for a user, we automatically run a simulation on that error and log it in a Slack group. Tenderly helps us reduce errors and understand why they are happening even when the user doesn’t complain”.

Additionally, users can share IDs of unsuccessful simulations with the Instadapp developers. They can then replay failed simulations, examine them in detail, and prioritize them for resolution.

In the early days, verifying addresses required manual checks through Etherscan. This process was draining and time-consuming, especially when multiple addresses had to be checked manually.

Troubleshooting individual transactions was even more tedious, requiring the team to sift through logs line by line. Without an intuitive UI, the team had to dig through the execution trace and call individual functions to understand where and why the error occurred.

Improving and simplifying the debugging process

However, by introducing Tenderly Debugger into their flows, Instadapp instantly saw a reduction in debugging time by 10x, resulting in improved code quality, platform reliability, and development velocity. With Tenderly, the Instadapp team gets an intuitive interface for debugging and analyzing transactions, smart contracts, errors, and much more from the browser.

This way, Instadapp consolidated debugging operations and can now ensure a more streamlined, collaborative debugging experience. With built-in collaboration features, the Instadapp team can flag individual lines of code and leave comments for other team members to investigate issues. As a result, Instadapp is able to deliver not only a better user experience but also improve the overall development experience for its team.

Improving developer experience

From the developer’s perspective, Shriya Tyagi says that debugging with Tenderly is not only seamless and intuitive but also “extremely addictive.” Shriya notes that Tenderly has helped improve her developer experience by making the development and debugging process easier to understand.

“By the time I joined, Tenderly was already a very big part of Instadapp. Tenderly is extremely addictive. It allows me to see at which point an issue has occurred with a transaction. From there, it’s really easy – one click to view in debug mode. Just one click to see the input and output.”

Testing new features, upgrades, and protocol integrations

The Instadapp team also integrated the simulation infrastructure into their development and testing flows. For instance, when integrating a new protocol, they test the integration with their dapp in a simulated environment.

This way, the Instadapp developers can check:

  • What the new protocol looks like in their dashboard.
  • What components need to be integrated.
  • Whether all the values are being properly updated.
  • Whether all the strategies work as expected.
đź’ˇ
Key takeaway:

The Tenderly Simulation Infrastructure helps Instadapp users try out dapp functionalities and test out DeFi strategies. It also helps the development team test any new feature, product development, or protocol integration against production data.

Integrate, simulate, and innovate with dapp simulation mode

With Tenderly’s support, Instadapp is able to create value for its users, build trust, and improve agility. Tenderly’s engineering support team is always there to help Instadapp overcome roadblocks and serve as a trusted support partner for their development team. As Thrilok Kumar says:

“The Tenderly team is very supportive, responsive, and always open to suggestions. If we have some new feature, we ask the Tenderly team for help, and they often create a customized solution for us”.

In the early days of Instadapp, tasks were simple and easy for a small group of engineers to handle. As the team and workload expanded, Tenderly played a key role in helping developers get more done in less time.

The Tenderly full-stack infrastructure empowers Instadapp’s engineers at each stage of the development cycle, from testing and debugging to production. Tenderly’s tightly integrated Simulator, Forks, and Debugger make up the backbone of Instadapp’s development process.

“The team has expanded, and we have done a lot more stuff. A lot of the calls have increased for a particular strategy and function. Practically, Tenderly is our go-to for any sort of error”, Shriya Tyagi explains.

With Tenderly’s full-stack infrastructure, the Instadapp team has found a partner for building a product that truly makes a difference in DeFi. By prioritizing users’ needs and security, they built a dapp simulation mode that benefits the entire community.

In return, this approach brought them a significant increase in interactions and volume in their product. So, do the same for your users and build a product that abstracts away the complexity of DeFi. Start with Tenderly’s simulations and make sure your dapp cuts through the noise.