Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Batch transactions #19

Open
DevDuki opened this issue Jun 12, 2023 · 2 comments
Open

[Feature Request] Batch transactions #19

DevDuki opened this issue Jun 12, 2023 · 2 comments

Comments

@DevDuki
Copy link

DevDuki commented Jun 12, 2023

To create a batch of transactions to send multiple transactions at once and save gas.

@AuroxDeFi
Copy link
Contributor

Although the upcoming Pro mode will batch transactions, it's not possible to save gas compared to "normal" transactions.

For example, let's assume you want to submit 2 transactions:

  1. Send tokenX from wallet1 to wallet2
  2. Execute tokenX swap using wallet2

You can submit these two transactions in variety of ways:

  1. As you normally would. Manually submitting them one after another
  2. Wallet automatically sends the first transactions, then the second transaction with only 1 user input.
  3. Bundling them and sending it to flashbots so they're executed in the same block.

In all 3 of these cases, each transaction is still submitted separately and still requires it's own gas fee.

The only way to submit multiple transactions inside a single transaction is by using smart contracts. A good example of this are DEX aggregators that split your order into multiple parts and distribute them across multiple DEXes.

In that scenario, it would require a smart contract to have a functionality designed specifically for your use case. For example, a DEX aggregator can't execute a flashloan. But if you created a separate smart contract, you can have it execute a flashloan and then a swap in the same transaction.

Was there a specific use case you were looking for?

@DevDuki
Copy link
Author

DevDuki commented Jun 17, 2023

This question came up from a discord member. I relayed your reply to them, but they haven't answered yet. Will get back to you once they answered.

Link to the member's question: https://discord.com/channels/784509363246071859/1040319538354475130/1115067720141115392

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants