Giter Site home page Giter Site logo

alhobishi22 / dex-aggregator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kaymen99/dex-aggregator

0.0 0.0 0.0 717 KB

Dapp that enable user to compare prices a cross different exchanges and swap at the best rate

License: MIT License

Shell 0.14% JavaScript 64.38% Python 5.71% CSS 4.32% HTML 2.80% Solidity 22.64%

dex-aggregator's Introduction

Dex-aggregator

With the ever growing DEFI world and the appearance of multiple decentralized exchanges on the different blockchains, the WEB3 ecosystem needs a way to compare the pros & cons of swapping on each DEX.

This excatly what Paraswap & 1inch protocol are trying to do, they aggregate the prices of tokens from multiple exchanges in each Blockchain (for example: uniswap, sushiswap, shibaswap in the Ethereum Mainnet), then they compare those prices and the swapping fee and offer to their user the best exchange rate possible.

In this Dapp, i built a simplified version of Paraswap it works on 4 blockchains: Ethereum, Polygon, Binance Smart Chain and the kovan testnet.For the moment it supports some well known tokens (ETH, Matic, Dai, USDC,...).

Dark

Built With

Getting Started

Prerequisites

Please install or have installed the following:

Installation

  1. Installing Brownie: Brownie is a python framework for smart contracts development,testing and deployments. It's quit like HardHat but it uses python for writing test and deployements scripts instead of javascript. Here is a simple way to install brownie.

     pip install --user pipx
     pipx ensurepath
     # restart your terminal
     pipx install eth-brownie
    

    Or if you can't get pipx to work, via pip (it's recommended to use pipx)

    pip install eth-brownie

    Install ganache-cli:

     npm install -g ganache-cli
  2. Clone the repo:

    git clone https://github.com/kaymen99/Dex-aggregator.git
    cd Dex-aggregator
  3. Set your environment variables To be able to deploy to real testnets you need to add your PRIVATE_KEY (You can find your PRIVATE_KEY from your ethereum wallet like metamask) and the infura project Id (just create an infura account it's free) to the .env file:

    PRIVATE_KEY=<PRIVATE_KEY>
    WEB3_INFURA_PROJECT_ID=<< YOUR INFURA PROJECT ID >>
    

    You can choose to use ethereum testnets like rinkeby, Kovan or any other evm compatible testnet. You'll also need some eth in the testnet. You can get it into your wallet by using a public faucet.

(back to top)

How to Use

After going throught the installation part you can start the app by running:

cd front-end
yarn
yarn start

The front-end is built using the following libraries:

  • Ethers.js: used as interface between the UI and the deployed smart contract
  • Web3modal: for conecting to Metamask
  • @reduxjs/toolkit & redux-persist: for managing the app states (account, balance, blockchain)
  • Material UI: used for react components and styles

There are 2 main components:
  • Swap component: It finds the best price possible for the user tokens from the supported exchanges and allow user to approve & excute the swap transaction
  • Exchanges component: For getting the token prices on the different exchanges

(back to top)

Contact

If you have any question or problem running this project just contact me: [email protected]

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

dex-aggregator's People

Contributors

kaymen99 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.