project screenshot 1
project screenshot 2
project screenshot 3

BatchSwap

A contract in which users can deposit ETH that gets batched and swapped for any token in UniswapV2. Benefit is saving gas in periods of high gas price, saving more than 50% of the swap cost, while the swapper gets a % of the value swapped as incentive to do so.

BatchSwap

Created At

ETHOnline 2023

Project Description

In periods in which mainnet is busy, with a lot of activity, gas prices increase a lot.

Swaps are one of the most common DeFi operations to perform, but in these periods, they become prohibitively expensive, only allowing whales to trade.

Batchswap is a solution to this - a uniswap wrapper that batches ETH deposits, which can be taken and swapped for the designated tokens by anyone. Why would someone do this? Because the swapper gets a % of the value swapped as a reward.

So, in numbers. Imagine 100 people want to swap in a high activity moment ETH for some popular token. They want to swap 100$ each, but swaps cost 30$ in gas. They deposit their 100$ in ETH in the batchswap contract, so now there is 10.000$ pooled (each paying 10-15$ in gas instead). Now, a swapper comes, as the prize is 1% of the value (so 100$). He pays 40$ to do the swap (because its more expensive to batchswap than to do a single swap due to the complexity), and obtains a profit of 60$.

The 100 users now how their tokens in the batchswap contract, which they can withdraw whenever they want (waiting for a period of less activity with lower gas prices, if prefered).

How it's Made

It is a simple contract with many mappings taking track of the deposited ETH of every contract and how many tokens were obtained in the round they participated.

The contract keeps track of the deposits for every token, allowing anyone to come and execute that batch-swap at any moment in order to claim the reward.

To keep it simple (and reduce gas costs), at the moment a user can multi deposit, but once someone batch swaps, the user has to withdraw before being able to deposit again.

background image mobile

Join the mailing list

Get the latest news and updates