https://github.com/moda20/newswamrttradeapi
New smart trade api. Dry run uniswap, pancakeswap, ... token swaps with precision and profit in mind
https://github.com/moda20/newswamrttradeapi
pancakeswap-bot swaps uniswap-bot uniswap-v2 web3
Last synced: 16 days ago
JSON representation
New smart trade api. Dry run uniswap, pancakeswap, ... token swaps with precision and profit in mind
- Host: GitHub
- URL: https://github.com/moda20/newswamrttradeapi
- Owner: moda20
- Created: 2021-09-18T20:50:41.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-10-28T22:04:11.000Z (over 2 years ago)
- Last Synced: 2025-10-31T08:28:09.359Z (9 months ago)
- Topics: pancakeswap-bot, swaps, uniswap-bot, uniswap-v2, web3
- Language: JavaScript
- Homepage: https://moda20.github.io/Portfolio/
- Size: 272 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Uniswap V2 Dry Run API Server
The Uniswap V2 Dry Run API Server is a Node.js Express.js application that allows you to perform dry runs of Uniswap V2
swaps on forked networks using Ganache. It also enables you to run multiple swaps with custom configurations.
Additionally, you can select the target node and specify from which block to fork.
## Features
- Dry run Uniswap V2 calls on forked networks using Ganache.
- Run multiple swaps with customizable configurations using the uniswap contracts or using a custom smartTrade solidity Contract
- Choose the target node and specify the block from which to fork.
## Prerequisites
Before getting started, make sure you have the following installed:
- [Node.js](https://nodejs.org/)
- [npm](https://www.npmjs.com/)
- [Ganache](https://www.trufflesuite.com/ganache)
## Installation
1. Clone the project repository:
```bash
git clone https://github.com/moda20/newSwamrtTradeApi.git
```
Change to the project directory:
```bash
cd newSwamrtTradeApi
```
Install the project dependencies:
```bash
npm install
```
### Configuration
The configuration file config/node.yml allows you to specify the following settings:
- rpcNodes: Number of nodes to start with the server.
- exec_node: nodes to run actual live transactions (not dry run).
### Usage
Start the Uniswap V2 Dry Run API Server:
```bash
npm start
```
Access the API endpoints to perform dry runs and run swaps.
### API Endpoints
* POST /api/SingleSwap: Perform a single swap with the possibility of running a dry run, or multiple consecutive swaps including many token hops.
* POST /api/depositWBNB: Deposit WBNB a standard ERC20 token with a ratio of 1 to 1 with BNB (can be used really for any tokens like WETH).
* POST /api/getBalance: returns the balance of a user in a specific token
* POST /api/getAmountsOut: Calculates the amountsOut of a swap based on a list of swap tokens
* POST /api/getAmountsIn: Calculates the amountsIn of a swap based on a list of swap tokens
* POST /api/dryExecute: Execute a list of swaps based on a token Path with the goal of acquiring a minimum of profit (arbitrage based)
* POST /api/reserves: read the reserves from the local database for all tokens
### Contributing
If you would like to contribute to this project, please open pull requests with descriptions or start by creating an issue.
### License
This project is licensed under the MIT License.
### Links
* [Uniswap V2](https://uniswap.org/)
* [Ganache](https://www.trufflesuite.com/ganache)
### Contact
For questions or support, please contact kadhem03@gmail.com