Coder Social home page Coder Social logo

arbitrage-bot-between-uniswap-and-sushiswap-with-flashloans's Introduction

+-YOU NEED TO MODIFICATE THE "index.js" FILE IN A WAY THAT IT MONITORS THE DIFFERENT PRICES OF THE SAME TOKENS IN DIFFERENT DECENTRALIZED EXCHANGES SO IT TRIGGERS THE "ArbitrageFlashLoaner.sol" S.C. AND PERFORMS THE ARBITRAGE TRADE AUTOMATICALLY.

+-For Testing the Successfully working "index.js" (when you have it) you should Test it with the S.C. Deployed and Verified in the Ropsten Ethereum TestNet:_ https://ropsten.etherscan.io/address/0x455835f93a2eab153b5f5d6f387c49aaa8ab9007

+You can get Ropsten Test Ether Here:_ https://faucet.dimensions.network/

+-Arbitrage Tutorials:_ https://blog.infura.io/build-a-flash-loan-arbitrage-bot-on-infura-part-i/ https://blog.infura.io/build-a-flash-loan-arbitrage-bot-on-infura-part-ii/

+-Quick Project start:_

+-(1)-The first things you need to do are cloning this repository and installing its dependencies:

npm install

+-(2-A)-Once installed, open a 1st Terminal and let's run Ropsten Ethereum Test Network(https://hardhat.org/tutorial/deploying-to-a-live-network.html):\_

npx hardhat run scripts/deploy.js --network ropsten

+-(2-B)-Or you can also Test your Project Cloning the Ethereum Main Network in your Local Hardhat Node:_ https://hardhat.org/guides/mainnet-forking.html

npx hardhat node

+-(3)-Then, you can run this to Test the Script "index.js" part of the Bot:_

npm run start

Note: There's an issue in ganache-core that can make the npm install step fail.

If you see npm ERR! code ENOLOCAL, try running npm ci instead of npm install.

Open http://localhost:3000/ to see your Dapp. You will need to have Metamask installed and listening to localhost 8545.

User Guide:_

You can find detailed instructions on using this repository and many tips in its documentation.

For a complete introduction to Hardhat, refer to this guide.

arbitrage-bot-between-uniswap-and-sushiswap-with-flashloans's People

Contributors

gwmccubbin avatar nachoxt17 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

arbitrage-bot-between-uniswap-and-sushiswap-with-flashloans's Issues

Cannot find ./abi folder and json

Hi, congratulations on this development

I'm trying to get it up and running so I can build on it.

I run into the problem that after successfully deploying my contract on the network. I throw the run command and it returns me that it cannot find the files inside the abi / folder. I don't know if I should fill this in manually. This is the mistake I take

ffvfvfvfvfvf

Still download json files to complete it but I'm afraid they are from other versions. These jsons inside abi / the ones I got from another repo, I'm afraid the versions and compilation don't match.

vffvvffvvvfvf

When I throw the first command

npx hardhat run scripts/deploy.js --network ropsten

vffvvfvfvfv

If I add the abi / xx.json manually the error that I find is this

vfvfvfvfvfvfvfvfvfvf

In the end, I think that the necessary .abi / will not be generated. Thanks for your time

Unable to deploy the ArbitrageFlashLoaner SC

I'm getting the following error when trying to deploy the ArbitrageFlashLoaner SC to Ropsten through Infura.io.
Hardhat v2.7.1.

C:\DEV\Arbitrage-Uniswap-Sushiswap>npx hardhat run scripts/deploy.js --network ropsten
Error HH606: The project cannot be compiled, see reasons below.

The Solidity version pragma statement in these files don't match any of the configured compilers in your config. Change the pragma or configure additional compiler versions in your hardhat config.

  * contracts/ArbitrageFlashLoaner.sol (^0.6.6)

To learn more, run the command again with --verbose

Read about compiler configuration at https://hardhat.org/config

Here is my hardhat.config.js:


require("@nomiclabs/hardhat-waffle");

const INFURA_API_KEY = "MY INFURA API KEY";

// Replace this private key with your Ropsten account private key
// To export your private key from Metamask, open Metamask and
// go to Account Details > Export Private Key
// Be aware of NEVER putting real Ether into testing accounts
const ROPSTEN_PRIVATE_KEY = "MY METAMASK PRIVATE KEY";

/**
 * @type import('hardhat/config').HardhatUserConfig
 */
module.exports = {
    solidity: "0.7.3",
    networks: {
        ropsten: {
            url: `https://ropsten.infura.io/v3/${INFURA_API_KEY}`,
            accounts: [`${ROPSTEN_PRIVATE_KEY}`]
        }
    }
};

In addition, can you please explain the following in .env:

  • Please explain FLASH_LOANER="0x455835F93a2eAb153B5f5D6F387C49AaA8ab9007"
  • Difference between PRIVATE_KEY and ROPSTEN_PRIVATE_KEY (from your Metamask wallet?)
  • INFURA_KEY - Is this the Infura Project ID?

Cannot find path to SafeMath.sol when deploying SC.

I have gotten to the point of trying to deploy the ArbitrageFlashLoaner SC but there appears to be some odd issue with the pathto SafeMath.sol:

image

Unable to find @openzeppelin/contracts/math/SafeMath.sol from contracts/UniswapV2Library.sol. Here are the files in my project:

image

Is there a way to be able to debug the deployment process where I could pause it and see the variable values throughout the process?

getPair failing for SushiSwap

any idea why the getPair function is failing on SushiSwap? The same call to Uniswap works!

// Ropsten testnet
const daiAddress = "0xf80a32a835f79d7787e8a8ee5721d0feafd78108";
const wethAddress = "0xf70949bc9b52deffcda63b0d15608d601e3a7c49";

sushiEthDai = new ethers.Contract(
await sushiFactory.getPair(wethAddress, daiAddress),
UniswapV2Pair.abi,
wallet
);
reason: null,
code: 'CALL_EXCEPTION',
method: 'getPair(address,address)',
errorSignature: null,
errorArgs: [ null ],
address: '0xC0AEe478e3658e2610c5F7A4A2E1777cE9e4f2Ac',
args: [
'0xf70949bc9b52deffcda63b0d15608d601e3a7c49',
'0xf80a32a835f79d7787e8a8ee5721d0feafd78108'
],
transaction: {
data: '0xe6a43905000000000000000000000000f70949bc9b52deffcda63b0d15608d601e3a7c49000000000000000000000000f80a32a835f79d7787e8a8ee5721d0feafd78108',
to: '0xC0AEe478e3658e2610c5F7A4A2E1777cE9e4f2Ac',
from: '0x6616CC3E907a84Bf40578D3b455233bA3C7D4309'
}

Issue on npm start after deploying contract to ropsten testnet

I have successfully deployed the contract on the Ropsten test network.

0x582C29C954f4C6dB9D63Ab16b80a0b17Ea4174E6

When running npm start, I receive this error stating that the getPair function may be having an issue? I have the index.js file configured as default from the repository. Seems that the script index.js is failing in the provider.on("block", async (blockNumber) => { try block, but I can't sort out exactly why this error is occurring. Any help is greatly appreciated, and thanks for putting this code out there!

$ npm start

Error:

DAI Amount:_ 500
Bot started!
(node:42905) UnhandledPromiseRejectionWarning: Error: call revert exception (method="getPair(address,address)", errorSignature=null, errorArgs=[null], reason=null, code=CALL_EXCEPTION, version=abi/5.1.2)
    at Logger.makeError (/home/eric/Desktop/projects/crypto_shit/Arbitrage-Bot-between-UniSwap-and-SushiSwap-with-FlashLoans/node_modules/@ethersproject/logger/lib/index.js:180:21)
    at Logger.throwError (/home/eric/Desktop/projects/crypto_shit/Arbitrage-Bot-between-UniSwap-and-SushiSwap-with-FlashLoans/node_modules/@ethersproject/logger/lib/index.js:189:20)
    at Interface.decodeFunctionResult (/home/eric/Desktop/projects/crypto_shit/Arbitrage-Bot-between-UniSwap-and-SushiSwap-with-FlashLoans/node_modules/@ethersproject/abi/lib/interface.js:289:23)
    at Contract.<anonymous> (/home/eric/Desktop/projects/crypto_shit/Arbitrage-Bot-between-UniSwap-and-SushiSwap-with-FlashLoans/node_modules/@ethersproject/contracts/lib/index.js:329:56)
    at step (/home/eric/Desktop/projects/crypto_shit/Arbitrage-Bot-between-UniSwap-and-SushiSwap-with-FlashLoans/node_modules/@ethersproject/contracts/lib/index.js:48:23)
    at Object.next (/home/eric/Desktop/projects/crypto_shit/Arbitrage-Bot-between-UniSwap-and-SushiSwap-with-FlashLoans/node_modules/@ethersproject/contracts/lib/index.js:29:53)
    at fulfilled (/home/eric/Desktop/projects/crypto_shit/Arbitrage-Bot-between-UniSwap-and-SushiSwap-with-FlashLoans/node_modules/@ethersproject/contracts/lib/index.js:20:58)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:42905) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:42905) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Where is the "dApp"

Hi, I've set up the repository via the .env configuration. I have successfully deployed the contract on the Ropsten test network.
It says in the documentation that the "dApp" runs on localhost:3000, however I don't see any code in this repo creating a user interface or even running a server on localhost:3000. Any clarification on this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.