This is a smart contract that allows for arbitrage trading between Uniswap and Sushiswap decentralized exchanges. The contract buys a token on Uniswap with ETH, and then sells the token on Sushiswap for a profit.
To get started with this contract, you will need the following:
- An Ethereum wallet with some ETH and the token you want to trade
- Knowledge of how to interact with smart contracts on the Ethereum network
- Access to the Uniswap and Sushiswap exchanges
There is no installation required for this contract. Simply deploy it on the Ethereum network using Remix or another Ethereum IDE.
To use this contract, follow these steps:
- Send the token you want to trade to the contract address
- Call the
swap
function on the contract, passing in the address of the token you want to trade and the amount of the token you want to trade. - The contract will buy the token on Uniswap with ETH, and then sell the token on Sushiswap for a profit.
- The profit will be sent to your wallet.
The contract uses the following interfaces:
IUniswapV2Router
: This is the interface for the Uniswap router contract, which allows for trading on Uniswap.ISushiSwapRouter
: This is the interface for the Sushiswap router contract, which allows for trading on Sushiswap.IWETH9
: This is the interface for the Wrapped ETH token, which is used for trading on Uniswap and Sushiswap.
The contract also uses the following constants:
WETH_ADDRESS
: This is the address of the Wrapped ETH token contract.UNISWAP_ROUTER_ADDRESS
: This is the address of the Uniswap router contract.SUSHISWAP_ROUTER_ADDRESS
: This is the address of the Sushiswap router contract.
The swap
function takes in two parameters: _address
and _amountIn
. _address
is the address of the token you want to trade, and _amountIn
is the amount of the token you want to trade.
The function does the following:
- Transfers the token from the sender to the contract.
- Approves the Uniswap router to spend the token.
- Buys the token on Uniswap with ETH.
- Approves the Sushiswap router to spend the token.
- Sells the token on Sushiswap for ETH.
- Sends the profit to the sender.
This code is licensed under the MIT license.