Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kaymen99/dex-aggregator
Dapp that enable user to compare prices a cross different exchanges and swap at the best rate
https://github.com/kaymen99/dex-aggregator
1inch aggregator decentralized-applications defi exchanges paraswap solidity uniswap-exchange
Last synced: about 1 month ago
JSON representation
Dapp that enable user to compare prices a cross different exchanges and swap at the best rate
- Host: GitHub
- URL: https://github.com/kaymen99/dex-aggregator
- Owner: kaymen99
- License: mit
- Created: 2022-04-22T22:31:47.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-11-20T22:28:01.000Z (about 2 years ago)
- Last Synced: 2023-03-17T23:22:20.112Z (almost 2 years ago)
- Topics: 1inch, aggregator, decentralized-applications, defi, exchanges, paraswap, solidity, uniswap-exchange
- Language: JavaScript
- Homepage:
- Size: 700 KB
- Stars: 5
- Watchers: 1
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## 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,...).
### Built With
* [Solidity](https://docs.soliditylang.org/)
* [Brownie](https://eth-brownie.readthedocs.io)
* [React.js](https://reactjs.org/)
* [ethers.js](https://docs.ethers.io/v5/)
* [web3modal](https://github.com/Web3Modal/web3modal)
* [material ui](https://mui.com/getting-started/installation/)## Getting Started
### Prerequisites
Please install or have installed the following:
* [nodejs and npm](https://nodejs.org/en/download/)
* [python](https://www.python.org/downloads/)
* [MetaMask](https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn) Chrome extension installed in your browser### Installation
1. Installing Brownie: Brownie is a python framework for smart contracts development,testing and deployments. It's quit like [HardHat](https://hardhat.org) 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)
```sh
pip install eth-brownie
```
Install [ganache-cli](https://www.npmjs.com/package/ganache-cli):
```sh
npm install -g ganache-cli
```
2. Clone the repo:
```sh
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=
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.## How to Use
After going throught the installation part you can start the app by running:
```sh
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
## Contact
If you have any question or problem running this project just contact me: [email protected]
## License
Distributed under the MIT License. See `LICENSE.txt` for more information.