Giter Site home page Giter Site logo

bobseal / dydxflashloanarb Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cryptopixelfrog/dydxflashloanarb

0.0 0.0 0.0 20 KB

Get Flashloan from DyDx, then do arbitrage trading between Kyber and Uniswap

License: MIT License

JavaScript 100.00%

dydxflashloanarb's Introduction

Arbitrage trading with DyDx Flashloan

Get Flashloan from DyDx, then do arbitrage trading between Kyber and Uniswap

Setting

First, you need to create .env file and add those info in there.

DYDXFLASHLOANARB=
TRADERWALLETADDR=
PRIVATEKEY=
NETENDPOINT=http://localhost:8546 OR https://mainnet.infura.io/v3/KEY

DYDXFLASHLOANARB your contract URL, TRADERWALLETADDR is your personal wallet address, and PRIVATEKEY is your wallet's privatekey. For NETENDPOINT, if you are using Infura, then add your infura dapp url. If you are using your local forked network, then you need to add http://localhost:PORT.

Tips

DyDx only supports those token assets:

// token address
address public WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
address public SAI = 0x89d24A6b4CcB1B6fAA2625fE562bDD9a23260359;
address public USDC = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;
address public DAI = 0x6B175474E89094C44Da98b954EedeAC495271d0F;

Kyber - tradeWithHint

KyberNetworkProxyInterface.tradeWithHint(
      srcToken, // source ERC20 token contract address
      srcQty, // source ERC20 token amount in its token decimals
      ETH_TOKEN_ADDRESS, // destination ERC20 token contract address
      address(this), // recipient address for destination ERC20 token
      10**28, // A limit on the amount of dest tokens
      minConversionRate, // The minimal conversion rate. If actual rate is lower, trade is canceled.
      address(0x0), // wallet address to send part of the fees to
      "PERM"
);

It is using Kyber's tradeWithHint to use Kyber's affiliate program. You can use swapTokenToToken instead.

Ref

Other Dapps

dydxflashloanarb's People

Contributors

cryptopixelfrog avatar

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.