Skip to content

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.

Notifications You must be signed in to change notification settings

ethan-crypto/dex-aggregator-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

c1ed44f · Jan 27, 2022

History

20 Commits
Jan 20, 2022
Dec 23, 2021
Jan 14, 2022
Jan 20, 2022
Jan 20, 2022
Dec 23, 2021
Jan 14, 2022
Jan 27, 2022
Jan 10, 2022
Jan 10, 2022
Jan 13, 2022

Repository files navigation

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

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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published