Tenderly Simulation API Integration

Description

Build a dapp that integrates Tenderly Simulations. Simulate a transaction and use the simulation result to determine if the transaction should be sent to the chain or discarded if it fails or results in undesired ways.

The goal is to use simulations to:

- minimize the occurrence of failed transactions and
- avoid transactions with undesired results from the user’s point of view.

**Approach:** You can use Simulations in several ways:

- Build a UI that lets users decide if the transaction should be sent to the chain, based on simulation results shown to the users.
- Build a programmatic decision-making process that automatically discards transactions that don’t fit the criteria specific to your dapp (e.g. swap can be better), and informs the users about it

**Integration:** You can integrate Tenderly Simulations in two ways:

- Using the tenderly_simulateTransaction JSON RPC call included with Web3 Gateway
- Using the REST Simulation API

3 winning projects will win 2000$ in USDC each!

Acceptance criteria

## Option 1: Enable users to discard undesired transactions in dapp UI

- Build a UI that shows relevant information about transaction execution (state changes, tokens swapped, changes to balances, or information derived from that, etc). The information should help the user decide if they want to send a transaction to the chain or discard it.
- Build a UI that enables users to approve sending the transaction to the chain or discard it after seeing the additional information (above).
- Demonstrate reduction of failed transactions: Provide an example of a failing transaction, whose failure is avoided by your solution (either a transaction object in README or video of building it through the UI).
- Demonstrate reduction of undesired transactions: Provide an example of a transaction that has suboptimal results, such that the user decides to discard it (either a transaction object in README or video of building it through the UI).
- [nice to have]: Build a mechanism to calculate and display suggestions for transaction inputs, so that transaction gets desirable results.

## Option 2: Automatically discard undesired transactions

- Provide written criteria for desirable transactions in the project’s README.
- Programmatically discard transactions with undesirable effects, according to criteria specific to your dapp.
- Inform the users that the transaction is automatically rejected, showing information about what led to the rejection.
- Provide an example of a failing (reverting) transaction, whose failure is avoided by your solution.
- Provide an example of a succeeding but undesirable transaction that gets automatically discarded (either transaction object in README or video of building it through the UI).
- [nice to have] Build a mechanism to calculate and display suggestions for transaction inputs, so that transaction gets desirable results.

Rewards

6000 reward pool

Resources

How to simulate a transaction using the Simulation API
https://docs.tenderly.co/simulations-and-forks/simulation-api
About Simulations
https://docs.tenderly.co/simulations-and-forks
JSON RPC simulation docs
https://docs.tenderly.co/web3-gateway/references/simulate-json-rpc