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

Case Study

How Enso Finance Carries on the Social Responsibility to Bring Transparency to DeFi With Simulations

Organization: Enso Finance

Website: enso.finance

Industry: Decentralized Finance

How Enso Finance uses Tenderly's transaction simulations to bring transparency to DeFi

Bringing access to all of DeFi in one place

The Enso team allows users to interact with all DeFi primitives using a single API or their platform interface.

Integrating simulations for greater confidence

Simulations are a part of Enso's internal testing processes and user-facing transaction sending.

Building transparency into DeFi

Using simulations, Enso Finance brings complete transparency to both its users and its team.

"If people interact with our products, we don't want them to lose any money anywhere. We feel a social responsibility for ensuring that people can interact safely with our products, and simulations allow us to do that."

Connor Howe

Co-founder and CEO, Enso Finance

Enso Finance is a DeFi platform that enables users to interact with all DeFi primitives in one place. It enables users to trade, swap, lend, borrow, and earn on their assets while automating the entire process. Enso users can do this either through the platform interface or by introducing the Enso API into their products without building their own integrations. 

The Enso Finance team allows users to bundle and execute multiple transactions across all DeFi protocols, such as Yearn Finance, Aave, and Compound. They achieved this by building a complex infrastructure consisting of the Enso pathfinder and transaction bundling that enables one transaction to be submitted for many nested DeFi actions by simply returning one calldata. 

However, the Enso engineers not only create one unified gateway to all of DeFi across all EVM chains, but they embed confidence and transparency into the process. How?

As Connor Howe, co-founder and CEO at Enso Finance explains: "If people interact with our products, we don't want them to lose any money anywhere. We feel a social responsibility for ensuring that people can interact safely with our products, and simulations allow us to do that.”

Bringing the Enso Finance vision to life

Coming from Aragon, Gnosis, Maker DAO, Polygon, and CoinFLEX, the seasoned devs started working on the first version of Enso Finance. The Enso V1 was a social trading platform where anyone could create trading strategies comprising ERC-20 tokens, yield farming, and so forth. Then, users coming to the platform could invest in the strategies and earn a percentage out of the earnings.

However, their vision was to interact with all of DeFi, so the Enso dev team decided to rebuild their entire architecture. The new architecture enables the Enso Finance system to interact with any arbitrary call. It interacts with every contract deployed on any of the EVM chains, bundles users' transactions across different protocols, and offers the most efficient routing path with optimal earned amounts and gas prices.

In the process of rebuilding their system, the Enso team wanted to provide their users with certainty, security, and transparency. For this reason, they decided to introduce transaction simulations and help users be certain of the success of their transactions. This led them to Tenderly, which was easy and quick to set up.

Integrating simulations for greater team and user confidence 

By introducing Tenderly simulations, the Enso development team is able to integrate new protocols quickly. They can test whether the integrations work through transaction simulations using different environments, starting states, block numbers, and other relevant parameters.

This way, the Enso team offers the best DeFi routes to their users while also empowering them with the same level of confidence. As Howe simply puts it:

“If we didn’t use Tenderly, we would not be able to create the product that we have now.”

And simulations help them achieve this in two ways. 

1. Simulations as a part of the Enso sanitization process 

First, the Enso engineering team uses simulations in their own internal processes to check if everything executes properly and find the best routes for their users. For instance, let’s say a user wants to deposit a token to a balancer pool. However, the user has USDC, but the pool accepts two different tokens, so they need to swap their USDC. 

The Enso team runs simulations in their own private environment to test the swap. They swap the tokens and deposit them to the balancer pool, checking if everything executes as expected. This way, they can determine the optimal route, checking: 

  • Whether the route works.
  • What the expected slippage is.
  • What the minimum earned amount is.
  • Whether there are any unexpected failures.
  • Whether you can exit a certain position once you’ve entered it.
Finding the optimal route with transaction simulations
Finding the optimal route with transaction simulations

As Howe further describes:

“For every single interaction for every single DeFi protocol, whether that's harvesting, entering, withdrawing, leveraging perps, whatever it may be, we use simulations. We call this a “sanitized list”.”

So, the Enso team runs everything through simulations to make sure it works. Once everything is tested, they can proceed with the next stage of their development and testing process. And before a specific action even reaches users, the team performs another final check with simulations. 

2. Simulations as a part of the Enso Transaction Cart 

Once the action reaches the users in the interface, the Enso team runs simulations for every interaction the user wants to perform. In the Enso Finance interface, users can enter 20 different DeFi positions within a single transaction into the Enso Transaction Cart.

At this stage, the Enso team employs Tenderly simulations in two ways: 

  1. They simulate every single position their users add to the Transaction Cart. Whenever users add individual positions across all DeFi protocols, the Enso system simulates them.
  2. They also simulate the entire bundle of transactions before executing them. The Enso system bundles individual positions into a single transaction and simulates the whole bundle before submitting it on-chain. 

This way, users get the maximum possible chance that everything works as expected and that there are no errors. Plus, they get a streamlined experience throughout the process with complete transparency. 

Simulated transactions with estimated earned amount and gas fees
Simulated transactions with estimated earned amount and gas fees

Sharing simulation data as a social responsibility for greater transparency

At that stage, the user gets all the information they need to be able to run their transactions with confidence. They receive a response with call data, including: 

  • How much gas their transactions spend. 
  • Which tokens will come out of the transactions. 
  • Any state modifications such as approvals and transfers. 

By exposing information about successful and failed transactions, the Enso team brings confidence and transparency to their users. “Before, you had no clue why sometimes your transactions were submitted and you never got the money. And that was really, really common in the industry”, describes Howes.

So, the Enso dev team feels the social responsibility to make this entire process more transparent and ensure their users can interact with their product safely. 

Additionally, the Enso team brings the same level of transparency to their internal process. For instance, if a transaction fails, they send a link to all of their team members to go directly into the Tenderly Dashboard. Then, they can inspect every single opcode, every single call trace, token changes, and so forth. 

“Simulations create a lot of transparency by showing token transfers, state changes, what works, what doesn’t work, and what events were emitted. And this goes not only for our team but for our users too. They can actually see what's happening, and that it's not just a black box, right? Simulations are an immediate diagnosis tool, but they also create more transparency in the ecosystem.”

DeFi security starts with simulations

The Enso Finance team invested a lot of time and effort into building a system that makes DeFi accessible to their users. With their one API or through their interface, users can interact with all of DeFi primitives in a single place. Plus, their system prioritizes users’ security, complete transparency, and ease of use. 

But they didn’t have to do it alone. With Tenderly’s simulation infrastructure, the Enso devs have maximized the chances of getting the best possible outcome out of DeFi positions. And all of this while showing what’s actually happening when sending transactions. 

So, ready for increased security? Try running simulations yourself and empower your users. And to interact with all DeFi primitives, give the Enso API a try and start exploring!