/poly-flashloan-bot

Flashloan Bot on Polygon

Primary LanguageTypeScriptMIT LicenseMIT

Poly Flashloan Bot

An open source flashloan bot on polygon network

Prerequisites

This flashloan bot works with the smart contract.

You need to deploy your own smart contract on polygon mainnet if you want to run this bot.

Installation

1. Install Node.js & yarn, if you haven't already.

2. Clone This Repo

Run the following command.

https://github.com/yuichiroaoki/poly-flashloan-bot.git
cd poly-flashloan-bot

Quickstart

1. Setup Environment Variables

You'll need an ALCHEMY_POLYGON_RPC_URL environment variable. You can get one from Alchemy website for free.

Then, you can create a .env file with the following.

ALCHEMY_POLYGON_RPC_URL='<your-own-alchemy-polygon-mainnet-rpc-url>'

If you want to execute flashloan on the polygon mainnet, you need to add your PRIVATE_KEY environment variable as well, with a private key from your wallet.

PRIVATE_KEY='your-PRIVATE_KEY'

*Note: If using metamask, you'll have to add a 0x to the start of your private key)

2. Install Dependencies

Run the following command.

yarn install

3. Add Your Deployed Smart Contract Address

Replace <your-deployed-contract-address> to your deployed smart contract address.

src/config.ts

export const flashloanAddress = "<your-deployed-contract-address>";

Note: If you update the flashloan smart contract, you need to replace this ABI to the new one.

4.Build

yarn build

5. Run Bot

yarn start

Configuration

Edit src/config.ts

ABI

This flashloan bot uses an ABI from this flashloan smart contract.

If you update the flashloan smart contract, you need to replace this ABI to the new one.

Docker

source startup.sh