Giter VIP home page Giter VIP logo

undergcrypto / dex-aggregator-tutorial Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ethan-crypto/dex-aggregator-tutorial

0.0 0.0 0.0 1.79 MB

A simple full stack application with smart contract that compares exchange rates for the weth/usdc trading pair across Uniswap and Sushiswap and then routes users swap to the dex with the best price.

JavaScript 82.97% CSS 3.24% HTML 3.62% Solidity 10.17%

dex-aggregator-tutorial's Introduction

Dex Aggregator

About

A simple full stack application with smart contract that compares exchange rates for the weth/usdc trading pair across Uniswap and Sushiswap and then routes users swap to the dex with the best price.

User Interface

Technology Stack & Tools

Requirements For Initial Setup

  • Install NodeJS, should work with any node version below 16.5.0
  • Install Truffle, In your terminal, you can check to see if you have truffle by running truffle version. To install truffle run npm i -g truffle. Ideal to have truffle version 5.4 to avoid dependency issues.
  • Install Ganache-cli. Install ganache globally by running npm install -g ganache-cli in your terminal

Setting Up

1. Clone/Download the Repository

$ git clone https://github.com/ethan-crypto/dex-aggregator-tutorial

2. Install Dependencies:

$ cd dex-aggregator-tutorial
$ npm install 

3. Get Infura URL

3. Start Ganache-cli as a fork of the mainnet and unlock account with a lot of USDC.

$ ganache-cli -f https://mainnet.infura.io/v3/11111111111111111
-u 0xc647F8f745a59B74A26d76Da7dcCc8BadF649C32

4. Connect you ganache-cli addresses to Metamask

  • Copy private key of the addresses in ganache and import to Metamask
  • Connect your metamask to network Localhost 8545

5. Run script that transfers USDC from unlcoked account to first development account

$ truffle exec ./scripts/transferUSDC.js

6. Migrate smart contracts

$ truffle migrate --reset

7. Run tests

$ truffle test

8. Run app locally

$ npm run start

License

MIT

dex-aggregator-tutorial's People

Contributors

ethan-crypto 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.